This commit is contained in:
John Firebaugh
2015-09-03 15:54:18 -07:00
parent aa001f07c3
commit 0531b38367
10 changed files with 239 additions and 242 deletions

View File

@@ -5,8 +5,6 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wshadow"
#include <node.h>
#include <node_version.h>
#include <nan.h>
#pragma GCC diagnostic pop
@@ -20,7 +18,7 @@ namespace util { template <typename T> class AsyncQueue; }
class NodeFileSource : public mbgl::FileSource {
public:
NodeFileSource(v8::Handle<v8::Object>);
NodeFileSource(v8::Local<v8::Object>);
~NodeFileSource();
mbgl::Request* request(const mbgl::Resource&, uv_loop_t*, Callback);
@@ -36,14 +34,10 @@ private:
void processAdd(const mbgl::Resource&);
void processCancel(const mbgl::Resource&);
v8::Persistent<v8::Object> options;
Nan::Persistent<v8::Object> options;
private:
#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION)
std::unordered_map<mbgl::Resource, v8::Persistent<v8::Object, v8::CopyablePersistentTraits<v8::Object>>, mbgl::Resource::Hash> pending;
#else
std::unordered_map<mbgl::Resource, v8::Persistent<v8::Object>, mbgl::Resource::Hash> pending;
#endif
std::unordered_map<mbgl::Resource, Nan::Persistent<v8::Object>, mbgl::Resource::Hash> pending;
// The observers list will hold pointers to all the requests waiting
// for a particular resource. The access must be guarded by a mutex