summaryrefslogtreecommitdiff
path: root/platform/default/include
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-16 16:29:12 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-21 01:04:01 +0300
commit1def782cf23736f06d0d6809ea0881f7913796b2 (patch)
tree376ed267234e4b04043738f8530ab1f6f2197b5e /platform/default/include
parent2a3a1c7bb36410c6037f1d8da46fa68733efbe42 (diff)
downloadqtlocation-mapboxgl-1def782cf23736f06d0d6809ea0881f7913796b2.tar.gz
[core] Add API for invalidating tiles
Add new APIs for invalidating tiles, effectively forcing Mapbox GL Native to check with the servers if the tiles are valid before using them. This is more efficient then deleting tiles, because in case of valid tiles, they won't get downloaded. Fixes #4376.
Diffstat (limited to 'platform/default/include')
-rw-r--r--platform/default/include/mbgl/storage/offline_database.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/default/include/mbgl/storage/offline_database.hpp b/platform/default/include/mbgl/storage/offline_database.hpp
index 3ba15d5813..3de829e635 100644
--- a/platform/default/include/mbgl/storage/offline_database.hpp
+++ b/platform/default/include/mbgl/storage/offline_database.hpp
@@ -51,6 +51,13 @@ public:
// Return value is (inserted, stored size)
std::pair<bool, uint64_t> put(const Resource&, const Response&);
+ // Force Mapbox GL Native to revalidate tiles stored in the ambient
+ // cache with the tile server before using them, making sure they
+ // are the latest version. This is more efficient than cleaning the
+ // cache because if the tile is considered valid after the server
+ // lookup, it will not get downloaded again.
+ std::exception_ptr invalidateTileCache();
+
expected<OfflineRegions, std::exception_ptr> listRegions();
expected<OfflineRegion, std::exception_ptr> createRegion(const OfflineRegionDefinition&,
@@ -63,6 +70,7 @@ public:
updateMetadata(const int64_t regionID, const OfflineRegionMetadata&);
std::exception_ptr deleteRegion(OfflineRegion&&);
+ std::exception_ptr invalidateRegion(int64_t regionID);
// Return value is (response, stored size)
optional<std::pair<Response, uint64_t>> getRegionResource(int64_t regionID, const Resource&);