summaryrefslogtreecommitdiff
path: root/platform/darwin/src/http_file_source.mm
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2019-09-17 14:34:47 -0700
committerFabian Guerra <fabian.guerra@mapbox.com>2019-10-07 15:22:01 -0700
commit0d59621876372068d4d1b375d7d52f24b59f3e78 (patch)
tree2cca2e35fdc0b73c1bec46d0aa61ad7781e50b45 /platform/darwin/src/http_file_source.mm
parent23cebe20fed0e3ebc3328c6345af4e32d86cfcf5 (diff)
downloadqtlocation-mapboxgl-0d59621876372068d4d1b375d7d52f24b59f3e78.tar.gz
[ios] Add a flag to pause network requests.
Diffstat (limited to 'platform/darwin/src/http_file_source.mm')
-rw-r--r--platform/darwin/src/http_file_source.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm
index b0f69f4a7f..09562e0347 100644
--- a/platform/darwin/src/http_file_source.mm
+++ b/platform/darwin/src/http_file_source.mm
@@ -229,6 +229,10 @@ NSURL *resourceURLWithAccountType(const Resource& resource, NSInteger accountTyp
std::unique_ptr<AsyncRequest> HTTPFileSource::request(const Resource& resource, Callback callback) {
auto request = std::make_unique<HTTPRequest>(callback);
auto shared = request->shared; // Explicit copy so that it also gets copied into the completion handler block below.
+
+ if ([MGLNetworkConfiguration sharedManager].stopsRequests) {
+ return std::move(request);
+ }
@autoreleasepool {
NSURL *url = resourceURLWithAccountType(resource, impl->accountType);