| 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)
|
| + {
|
| + 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);
|
| + }
|
| +
|
| + 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)
|
|
|