summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinícius dos Santos Oliveira <vini.ipsmaker@expertisesolutions.com.br>2015-06-03 01:09:39 -0300
committerVinícius dos Santos Oliveira <vini.ipsmaker@expertisesolutions.com.br>2015-06-03 01:09:39 -0300
commit77ffb055a15aee55ba2a84e890955433ce697cb2 (patch)
tree3090ad18f8d9040ff872b74d00819b531859758d
parent3d28180eadbc56b6e28a864fe47ed62636cefd58 (diff)
[eina_js] add: now compatibility_persistent will store v8::Isolate
-rw-r--r--src/bindings/eina_js/eina_js_compatibility.hh16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bindings/eina_js/eina_js_compatibility.hh b/src/bindings/eina_js/eina_js_compatibility.hh
index 72d054d..7e8792c 100644
--- a/src/bindings/eina_js/eina_js_compatibility.hh
+++ b/src/bindings/eina_js/eina_js_compatibility.hh
@@ -337,6 +337,7 @@ struct compatibility_persistent<T, true> : v8::UniquePersistent<T>
337 compatibility_persistent() {} 337 compatibility_persistent() {}
338 compatibility_persistent(v8::Isolate* isolate, v8::Handle<T> v) 338 compatibility_persistent(v8::Isolate* isolate, v8::Handle<T> v)
339 : _base(isolate, v) 339 : _base(isolate, v)
340 , isolate(isolate)
340 { 341 {
341 } 342 }
342 343
@@ -345,7 +346,12 @@ struct compatibility_persistent<T, true> : v8::UniquePersistent<T>
345 return *handle(); 346 return *handle();
346 } 347 }
347 348
348 v8::Handle<T> handle() const { return v8::Local<T>::New(v8::Isolate::GetCurrent(), *this); } 349 v8::Handle<T> handle() const { return v8::Local<T>::New(isolate, *this); }
350
351 v8::Isolate* GetIsolate() { return isolate; }
352
353private:
354 v8::Isolate *isolate;
349}; 355};
350 356
351template <typename T> 357template <typename T>
@@ -354,13 +360,19 @@ struct compatibility_persistent<T, false> : v8::Persistent<T>
354 typedef v8::Persistent<T> _base; 360 typedef v8::Persistent<T> _base;
355 361
356 compatibility_persistent() {} 362 compatibility_persistent() {}
357 compatibility_persistent(v8::Isolate*, v8::Handle<T> v) 363 compatibility_persistent(v8::Isolate *isolate, v8::Handle<T> v)
358 : _base(v) 364 : _base(v)
365 , isolate(isolate)
359 { 366 {
360 } 367 }
361 368
362 v8::Handle<T>& handle() { return *this; } 369 v8::Handle<T>& handle() { return *this; }
363 v8::Handle<T> const& handle() const { return *this; } 370 v8::Handle<T> const& handle() const { return *this; }
371
372 v8::Isolate* GetIsolate() { return isolate; }
373
374private:
375 v8::Isolate *isolate;
364}; 376};
365 377
366template <typename T = std::integral_constant<bool, v8_uses_isolate> > 378template <typename T = std::integral_constant<bool, v8_uses_isolate> >