summaryrefslogtreecommitdiff
path: root/include/mbgl/storage/default/request.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/storage/default/request.hpp')
-rw-r--r--include/mbgl/storage/default/request.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/mbgl/storage/default/request.hpp b/include/mbgl/storage/default/request.hpp
index 648585f304..b686d1fe90 100644
--- a/include/mbgl/storage/default/request.hpp
+++ b/include/mbgl/storage/default/request.hpp
@@ -15,13 +15,14 @@ typedef struct uv_loop_s uv_loop_t;
namespace mbgl {
class Response;
+class Environment;
class Request : private util::noncopyable {
MBGL_STORE_THREAD(tid)
public:
using Callback = std::function<void(const Response &)>;
- Request(const Resource &resource, uv_loop_t *loop, Callback callback);
+ Request(const Resource &resource, uv_loop_t *loop, const Environment &env, Callback callback);
public:
// May be called from any thread.
@@ -45,6 +46,11 @@ private:
public:
const Resource resource;
+
+ // The environment ref is used to associate requests with a particular environment. This allows
+ // us to only terminate requests associated with that environment, e.g. when the map the env
+ // belongs to is discarded.
+ const Environment &env;
};
}