diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/storage/default_file_source.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/storage/file_source.hpp | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/mbgl/storage/default_file_source.hpp b/include/mbgl/storage/default_file_source.hpp index e77befda1b..235e738254 100644 --- a/include/mbgl/storage/default_file_source.hpp +++ b/include/mbgl/storage/default_file_source.hpp @@ -26,6 +26,10 @@ public: uint64_t maximumCacheSize = util::DEFAULT_MAX_CACHE_SIZE); ~DefaultFileSource() override; + bool supportsOptionalRequests() const override { + return true; + } + void setAccessToken(const std::string&); std::string getAccessToken() const; diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp index 88e0336187..404c683fdb 100644 --- a/include/mbgl/storage/file_source.hpp +++ b/include/mbgl/storage/file_source.hpp @@ -23,6 +23,14 @@ public: // If the request is cancelled before the callback is executed, the callback will // not be executed. virtual std::unique_ptr<AsyncRequest> request(const Resource&, Callback) = 0; + + // When a file source supports optional requests, it must return true. + // Optional requests are requests that aren't as urgent, but could be useful, e.g. + // to cover part of the map while loading. The FileSource should only do cheap actions to + // retrieve the data, e.g. load it from a cache, but not from the internet. + virtual bool supportsOptionalRequests() const { + return false; + } }; } // namespace mbgl |