summaryrefslogtreecommitdiff
path: root/include/mbgl/storage
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-07-21 16:37:18 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-08-23 09:55:32 -0700
commit86cccc4d24804d40ea9d15d47ee1edb975bbf2e3 (patch)
tree7613b3a6546c4fb48c3f73069bbdde47e6a03e4d /include/mbgl/storage
parent5511e9a4e85c8eb8a67a8cfc56a2b1f665a8940d (diff)
downloadqtlocation-mapboxgl-86cccc4d24804d40ea9d15d47ee1edb975bbf2e3.tar.gz
[core] Don't allow style mutations to be overwritten by revalidation
* Once we get a fresh style, stop revalidating. * If the style is mutated, stop revalidating and preserve the existing mutations.
Diffstat (limited to 'include/mbgl/storage')
-rw-r--r--include/mbgl/storage/response.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/storage/response.hpp b/include/mbgl/storage/response.hpp
index 6c79f5e181..4dc3f36681 100644
--- a/include/mbgl/storage/response.hpp
+++ b/include/mbgl/storage/response.hpp
@@ -32,6 +32,10 @@ public:
optional<Timestamp> modified;
optional<Timestamp> expires;
optional<std::string> etag;
+
+ bool isFresh() const {
+ return !expires || *expires > util::now();
+ }
};
class Response::Error {