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-07 23:54:09 -0800 |
commit | 6d9f13ec28da8dacac33577b4e830e83f87a55c0 (patch) | |
tree | 4f159dd474bde9a841b62e4fd4f55c53d4e04acf /platform/darwin/src/MGLOfflineStorage.mm | |
parent | daccbaffbc902f4a9d69975ce06e76b9d8a62dde (diff) | |
download | qtlocation-mapboxgl-6d9f13ec28da8dacac33577b4e830e83f87a55c0.tar.gz |
[ios, macos] Renamed ambient cache prewarming methodupstream/1ec5-offline-put-rename
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 |