[node] NodeRequest inherits from Nan::AsyncWorker

drop NodeRequest::Create, move MakeCallback to NodeRequest::Execute

rework Respond -> HandleCallback

modern NAN style updates
This commit is contained in:
Mike Morris
2016-07-12 18:37:28 -04:00
parent 480be63396
commit 7df0e459b6
7 changed files with 153 additions and 156 deletions

View File

@@ -18,22 +18,27 @@ public:
struct RenderOptions;
class RenderWorker;
NodeMap(v8::Local<v8::Object>);
~NodeMap();
static Nan::Persistent<v8::Function> constructor;
static NAN_MODULE_INIT(Init);
static NAN_METHOD(New);
static NAN_METHOD(Load);
static NAN_METHOD(Loaded);
static NAN_METHOD(Render);
static NAN_METHOD(Release);
static NAN_METHOD(AddClass);
static NAN_METHOD(AddSource);
static NAN_METHOD(AddLayer);
static NAN_METHOD(RemoveLayer);
static NAN_METHOD(SetLayoutProperty);
static NAN_METHOD(SetPaintProperty);
static NAN_METHOD(SetFilter);
static NAN_METHOD(DumpDebugLogs);
static NAN_METHOD(QueryRenderedFeatures);
static void New(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Load(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Loaded(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Render(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Release(const Nan::FunctionCallbackInfo<v8::Value>&);
static void AddClass(const Nan::FunctionCallbackInfo<v8::Value>&);
static void AddSource(const Nan::FunctionCallbackInfo<v8::Value>&);
static void AddLayer(const Nan::FunctionCallbackInfo<v8::Value>&);
static void RemoveLayer(const Nan::FunctionCallbackInfo<v8::Value>&);
static void SetLayoutProperty(const Nan::FunctionCallbackInfo<v8::Value>&);
static void SetPaintProperty(const Nan::FunctionCallbackInfo<v8::Value>&);
static void SetFilter(const Nan::FunctionCallbackInfo<v8::Value>&);
static void DumpDebugLogs(const Nan::FunctionCallbackInfo<v8::Value>&);
static void QueryRenderedFeatures(const Nan::FunctionCallbackInfo<v8::Value>&);
void startRender(RenderOptions options);
void renderFinished();
@@ -41,12 +46,8 @@ public:
void release();
static RenderOptions ParseOptions(v8::Local<v8::Object>);
static Nan::Persistent<v8::Function> constructor;
NodeMap(v8::Local<v8::Object>);
~NodeMap();
std::unique_ptr<mbgl::AsyncRequest> request(const mbgl::Resource&, Callback);
std::unique_ptr<mbgl::AsyncRequest> request(const mbgl::Resource&, mbgl::FileSource::Callback);
mbgl::HeadlessView view;
std::unique_ptr<mbgl::Map> map;