Index: Source/bindings/v8/DOMDataStore.h |
diff --git a/Source/bindings/v8/DOMDataStore.h b/Source/bindings/v8/DOMDataStore.h |
index 64b040d3f2e9b062eca45b3968dc16d4299658bf..154d8d8d1ba09d407e5ce8afe1ac3631045edb46 100644 |
--- a/Source/bindings/v8/DOMDataStore.h |
+++ b/Source/bindings/v8/DOMDataStore.h |
@@ -101,6 +101,20 @@ public: |
} |
template<typename V8T, typename T> |
+ static void setWrapperReference(const v8::Persistent<v8::Object>& parent, T* child, v8::Isolate* isolate) |
haraken
2013/10/29 01:14:53
Since you're using "setWrapperReference" here...
|
+ { |
+ if (ScriptWrappable::wrapperCanBeStoredInObject(child) && !canExistInWorker(child)) { |
+ if (LIKELY(!DOMWrapperWorld::isolatedWorldsExist())) { |
+ UnsafePersistent<v8::Object> unsafePersistent = ScriptWrappable::getUnsafeWrapperFromObject(child); |
+ // Security: always guard against malicious tampering. |
+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(unsafePersistent.isEmpty() || unsafePersistent.value()->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex) == V8T::toInternalPointer(child)); |
+ unsafePersistent.setReferenceFrom(parent, isolate); |
+ } |
+ } |
+ current(isolate)->template setReference<V8T>(parent, child, isolate); |
haraken
2013/10/29 01:14:53
...shall we rename:
setReference => setWrapperRef
kouhei (in TOK)
2013/10/29 04:19:58
I guess this issue is resolved from offline discus
|
+ } |
+ |
+ template<typename V8T, typename T> |
static void setWrapper(T* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperConfiguration& configuration) |
{ |
if (ScriptWrappable::wrapperCanBeStoredInObject(object) && !canExistInWorker(object)) { |
@@ -127,6 +141,16 @@ public: |
} |
template<typename V8T, typename T> |
+ inline void setReference(const v8::Persistent<v8::Object>& parent, T* child, v8::Isolate* isolate) |
+ { |
+ if (ScriptWrappable::wrapperCanBeStoredInObject(child) && m_type == MainWorld) { |
+ ScriptWrappable::getUnsafeWrapperFromObject(child).setReferenceFrom(parent, isolate); |
+ return; |
+ } |
+ m_wrapperMap.setReference(parent, V8T::toInternalPointer(child), isolate); |
+ } |
+ |
+ template<typename V8T, typename T> |
inline bool setReturnValueFrom(v8::ReturnValue<v8::Value> returnValue, T* object) |
{ |
if (ScriptWrappable::wrapperCanBeStoredInObject(object) && m_type == MainWorld) |