Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h

Issue 2617733004: binding: Changes the association among global-proxy/global/window-instance. (Closed)
Patch Set: Addressed review comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « third_party/WebKit/Source/bindings/bindings.gni ('k') | third_party/WebKit/Source/bindings/core/v8/DOMWrapperMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698