summaryrefslogtreecommitdiff
path: root/include/mbgl/storage
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-06-08 18:40:11 -0400
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-07-01 15:21:10 -0700
commit5fadda53e5cf7044ead3a3e688c557c7af290453 (patch)
tree8c3314f5c1e7bdcfd614eb032d74658c27688d1d /include/mbgl/storage
parentd596d9dc381170013563348b7af46812f6fcf790 (diff)
downloadqtlocation-mapboxgl-5fadda53e5cf7044ead3a3e688c557c7af290453.tar.gz
Move WorkerTask functionality into RunLoop core
As a byproduct, this makes FileCache get requests properly cancelable.
Diffstat (limited to 'include/mbgl/storage')
-rw-r--r--include/mbgl/storage/file_cache.hpp3
-rw-r--r--include/mbgl/storage/sqlite_cache.hpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/include/mbgl/storage/file_cache.hpp b/include/mbgl/storage/file_cache.hpp
index f815d5b8c2..a9071b1b67 100644
--- a/include/mbgl/storage/file_cache.hpp
+++ b/include/mbgl/storage/file_cache.hpp
@@ -10,6 +10,7 @@ namespace mbgl {
struct Resource;
class Response;
+class WorkRequest;
class FileCache : private util::noncopyable {
public:
@@ -18,7 +19,7 @@ public:
enum class Hint : uint8_t { Full, Refresh, No };
using Callback = std::function<void(std::unique_ptr<Response>)>;
- virtual void get(const Resource &resource, Callback callback) = 0;
+ virtual std::unique_ptr<WorkRequest> get(const Resource &resource, Callback callback) = 0;
virtual void put(const Resource &resource, std::shared_ptr<const Response> response, Hint hint) = 0;
};
diff --git a/include/mbgl/storage/sqlite_cache.hpp b/include/mbgl/storage/sqlite_cache.hpp
index fd67d48bb5..65328652f4 100644
--- a/include/mbgl/storage/sqlite_cache.hpp
+++ b/include/mbgl/storage/sqlite_cache.hpp
@@ -17,7 +17,7 @@ public:
~SQLiteCache() override;
// FileCache API
- void get(const Resource &resource, Callback callback) override;
+ std::unique_ptr<WorkRequest> get(const Resource &resource, Callback callback) override;
void put(const Resource &resource, std::shared_ptr<const Response> response, Hint hint) override;
class Impl;