diff options
author | Blake Thompson <blake@mapbox.com> | 2019-06-26 13:38:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-26 13:38:06 -0500 |
commit | a16c67d953926bd9b86359316b983d01825fd0f2 (patch) | |
tree | bab00ce4f91d46a8c2cd1a17a3be18503adf1131 /platform/node/src/node_request.hpp | |
parent | 012ccecaa4329608d2f7c8a30d3e8902b1fee372 (diff) | |
download | qtlocation-mapboxgl-a16c67d953926bd9b86359316b983d01825fd0f2.tar.gz |
Fixes problems associated with node 10 and NAN (#14847)
* Fixes problems associated with node 10 and NAN
* Follow up removal of unnecessary linking to map object
* Remove header left over from debugging
Diffstat (limited to 'platform/node/src/node_request.hpp')
-rw-r--r-- | platform/node/src/node_request.hpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/platform/node/src/node_request.hpp b/platform/node/src/node_request.hpp index 7d7679a3c7..830d262b40 100644 --- a/platform/node/src/node_request.hpp +++ b/platform/node/src/node_request.hpp @@ -11,18 +11,19 @@ namespace node_mbgl { -class NodeMap; +class NodeRequest; + +struct NodeAsyncRequest : public mbgl::AsyncRequest { + NodeAsyncRequest(); + ~NodeAsyncRequest() override; + NodeRequest* request; +}; + +class NodeRequest : public Nan::ObjectWrap { -class NodeRequest : public Nan::ObjectWrap, - public Nan::AsyncWorker { public: - struct NodeAsyncRequest : public mbgl::AsyncRequest { - NodeAsyncRequest(NodeRequest*); - ~NodeAsyncRequest() override; - NodeRequest* request; - }; - NodeRequest(NodeMap*, mbgl::FileSource::Callback); + NodeRequest(mbgl::FileSource::Callback, NodeAsyncRequest*); ~NodeRequest(); static Nan::Persistent<v8::Function> constructor; @@ -32,12 +33,11 @@ public: static void New(const Nan::FunctionCallbackInfo<v8::Value>&); static void HandleCallback(const Nan::FunctionCallbackInfo<v8::Value>&); - void Execute(); + void unref(); -private: - NodeMap* target; mbgl::FileSource::Callback callback; - NodeAsyncRequest* asyncRequest = nullptr; + NodeAsyncRequest* asyncRequest; + Nan::AsyncResource* asyncResource = new Nan::AsyncResource("mbgl:execute"); }; } |