[core] DefaultFileSource dynamic support for cache-only requests

This commit is contained in:
Bruno de Oliveira Abinader
2019-06-13 18:56:35 +03:00
parent 8367c2ed5c
commit 1a9e07e4ed
5 changed files with 40 additions and 17 deletions

View File

@@ -10,6 +10,7 @@ public:
std::string cachePath = ":memory:";
std::string assetPath = ".";
uint64_t maximumSize = mbgl::util::DEFAULT_MAX_CACHE_SIZE;
bool supportCacheOnlyRequests = true;
void* platformContext = nullptr;
};
@@ -68,6 +69,15 @@ uint64_t ResourceOptions::maximumCacheSize() const {
return impl_->maximumSize;
}
ResourceOptions& ResourceOptions::withCacheOnlyRequestsSupport(bool supportCacheOnlyRequests) {
impl_->supportCacheOnlyRequests = supportCacheOnlyRequests;
return *this;
}
bool ResourceOptions::supportsCacheOnlyRequests() const {
return impl_->supportCacheOnlyRequests;
}
ResourceOptions& ResourceOptions::withPlatformContext(void* context) {
impl_->platformContext = context;
return *this;