[core] Use std::unique_ptr for FileSource request

This commit is contained in:
John Firebaugh
2015-11-12 15:51:45 -08:00
parent 1caf89c32b
commit 7137239cbd
42 changed files with 298 additions and 617 deletions

View File

@@ -8,8 +8,7 @@
#pragma GCC diagnostic pop
#include <mbgl/storage/resource.hpp>
#include <memory>
#include <mbgl/storage/file_source.hpp>
namespace node_mbgl {
@@ -22,17 +21,13 @@ public:
static NAN_METHOD(New);
static NAN_METHOD(Respond);
static v8::Handle<v8::Object> Create(NodeFileSource*, const mbgl::Resource&);
static v8::Handle<v8::Object> Create(const mbgl::Resource&, mbgl::FileSource::Callback);
static Nan::Persistent<v8::Function> constructor;
NodeRequest(NodeFileSource* source, const mbgl::Resource& resource);
~NodeRequest();
void cancel();
NodeRequest(mbgl::FileSource::Callback);
private:
NodeFileSource* source;
std::unique_ptr<mbgl::Resource> resource;
mbgl::FileSource::Callback callback;
};
}