diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-11-07 23:48:15 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-11-08 14:40:23 -0800 |
commit | d13cd54af64b9bcac9ae076b33d56b2af8313803 (patch) | |
tree | 9b50d72d5f1eccded9a0935650a922d04e95716c /platform/darwin/src/MGLOfflineStorage.mm | |
parent | ad235d3f6c12e784511893a8219f32a004fe158b (diff) | |
download | qtlocation-mapboxgl-d13cd54af64b9bcac9ae076b33d56b2af8313803.tar.gz |
[ios, macos] Renamed ambient cache prewarming method
Renamed the method for prewarming the ambient cache to conform to Cocoa and Swift naming conventions.
Diffstat (limited to 'platform/darwin/src/MGLOfflineStorage.mm')
-rw-r--r-- | platform/darwin/src/MGLOfflineStorage.mm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm index c5b08b8bc7..5e50e83274 100644 --- a/platform/darwin/src/MGLOfflineStorage.mm +++ b/platform/darwin/src/MGLOfflineStorage.mm @@ -490,14 +490,14 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio return attributes.fileSize; } --(void)putResourceWithUrl:(NSURL *)url data:(NSData *)data modified:(NSDate * _Nullable)modified expires:(NSDate * _Nullable)expires etag:(NSString * _Nullable)etag mustRevalidate:(BOOL)mustRevalidate { - mbgl::Resource resource(mbgl::Resource::Kind::Unknown, [[url absoluteString] UTF8String]); +- (void)preloadData:(NSData *)data forURL:(NSURL *)url modificationDate:(nullable NSDate *)modified expirationDate:(nullable NSDate *)expires eTag:(nullable NSString *)eTag mustRevalidate:(BOOL)mustRevalidate { + mbgl::Resource resource(mbgl::Resource::Kind::Unknown, url.absoluteString.UTF8String); mbgl::Response response; response.data = std::make_shared<std::string>(static_cast<const char*>(data.bytes), data.length); response.mustRevalidate = mustRevalidate; - if (etag) { - response.etag = std::string([etag UTF8String]); + if (eTag) { + response.etag = std::string(eTag.UTF8String); } if (modified) { @@ -511,5 +511,8 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio _mbglFileSource->put(resource, response); } +- (void)putResourceWithUrl:(NSURL *)url data:(NSData *)data modified:(nullable NSDate *)modified expires:(nullable NSDate *)expires etag:(nullable NSString *)etag mustRevalidate:(BOOL)mustRevalidate { + [self preloadData:data forURL:url modificationDate:modified expirationDate:expires eTag:etag mustRevalidate:mustRevalidate]; +} @end |