diff options
author | M.Stephen <truestyle2005@163.com> | 2019-12-12 18:10:09 +0800 |
---|---|---|
committer | M.Stephen <truestyle2005@163.com> | 2019-12-12 18:10:09 +0800 |
commit | a72e6510547a0db66d136c1ea7405cd362ca70c4 (patch) | |
tree | a818cf82fa2a9627d8c0a50850d947941a55c91e | |
parent | 29397ff602d1c35873c9a577882fd34307290aaf (diff) | |
download | qtlocation-mapboxgl-a72e6510547a0db66d136c1ea7405cd362ca70c4.tar.gz |
update http_file_source
-rw-r--r-- | platform/darwin/src/http_file_source.mm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm index 769a9e9c23..ade0aba229 100644 --- a/platform/darwin/src/http_file_source.mm +++ b/platform/darwin/src/http_file_source.mm @@ -83,13 +83,13 @@ class HTTPFileSource::Impl { public: Impl() { @autoreleasepool { - NSURLSessionConfiguration *sessionConfig = MGLNativeAppleInterfaceTransmitter.shared.sessionConfiguration; + NSURLSessionConfiguration *sessionConfig = MGLNativeNetworkDelegate.shared.sessionConfiguration; session = [NSURLSession sessionWithConfiguration:sessionConfig]; userAgent = getUserAgent(); #if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR - accountType = [[NSUserDefaults standardUserDefaults] integerForKey:MGLNativeAppleInterfaceTransmitter.shared.accountTypeKey]; + accountType = [[NSUserDefaults standardUserDefaults] integerForKey:MGLNativeNetworkDelegate.shared.accountTypeKey]; #endif } } @@ -212,7 +212,7 @@ NSURL *resourceURLWithAccountType(const Resource& resource, NSInteger accountTyp [queryItems addObject:[NSURLQueryItem queryItemWithName:@"offline" value:@"true"]]; } else { // Only add SKU token to requests not tagged as "offline" usage. - [queryItems addObject:[NSURLQueryItem queryItemWithName:@"sku" value:MGLNativeAppleInterfaceTransmitter.shared.skuToken]]; + [queryItems addObject:[NSURLQueryItem queryItemWithName:@"sku" value:MGLNativeNetworkDelegate.shared.skuToken]]; } if (components.queryItems) { @@ -249,17 +249,17 @@ std::unique_ptr<AsyncRequest> HTTPFileSource::request(const Resource& resource, const bool isTile = resource.kind == mbgl::Resource::Kind::Tile; if (isTile) { - [MGLNativeAppleInterfaceTransmitter.shared startDownloadEvent:url.relativePath type:@"tile"]; + [MGLNativeNetworkDelegate.shared startDownloadEvent:url.relativePath type:@"tile"]; } request->task = [impl->session dataTaskWithRequest:req completionHandler:^(NSData* data, NSURLResponse* res, NSError* error) { if (error && [error code] == NSURLErrorCancelled) { - [MGLNativeAppleInterfaceTransmitter.shared cancelDownloadEventForResponse:res]; + [MGLNativeNetworkDelegate.shared cancelDownloadEventForResponse:res]; return; } - [MGLNativeAppleInterfaceTransmitter.shared stopDownloadEventForResponse:res]; + [MGLNativeNetworkDelegate.shared stopDownloadEventForResponse:res]; Response response; using Error = Response::Error; |