Index: third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h |
diff --git a/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h b/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h |
index 7a062392da6560982d1c259fa5e59b07827bc327..9969a1e40591c65e161437992a93e1d9ee5acd8a 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h |
+++ b/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h |
@@ -156,6 +156,12 @@ class DOMDataStore { |
m_wrapperMap->markWrapper(scriptWrappable); |
} |
+ // Dissociates a wrapper, if any, from |scriptWrappable|. |
+ void unsetWrapperIfAny(ScriptWrappable* scriptWrappable) { |
+ DCHECK(!m_isMainWorld); |
+ m_wrapperMap->removeIfAny(scriptWrappable); |
+ } |
+ |
bool setReturnValueFrom(v8::ReturnValue<v8::Value> returnValue, |
ScriptWrappable* object) { |
if (m_isMainWorld) |
@@ -213,18 +219,16 @@ class DOMDataStore { |
template <> |
inline void DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::Dispose( |
v8::Isolate*, |
- v8::Global<v8::Object> value, |
+ v8::Global<v8::Object>, |
ScriptWrappable*) { |
- toWrapperTypeInfo(value)->wrapperDestroyed(); |
+ WrapperTypeInfo::wrapperDestroyed(); |
} |
template <> |
inline void |
DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWeak( |
- const v8::WeakCallbackInfo<WeakCallbackDataType>& data) { |
- auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>( |
- data.GetInternalField(v8DOMWrapperTypeIndex)); |
- wrapperTypeInfo->wrapperDestroyed(); |
+ const v8::WeakCallbackInfo<WeakCallbackDataType>&) { |
+ WrapperTypeInfo::wrapperDestroyed(); |
} |
} // namespace blink |