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

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: Fixed Document.defaultView Created 3 years, 11 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 272c55149e824c63d1a9f82d6811b3eff2cae980..b6cfef648cb85763b0b2df72eaa8ef12f892beca 100644
--- a/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h
+++ b/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h
@@ -183,6 +183,12 @@ class DOMDataStore {
m_wrapperMap->setReference(isolate, parent, child);
}
+ // Dissociates a wrapper, if any, from |scriptWrappable|.
haraken 2017/02/09 12:46:40 Dissociate => Disconnect ?
Yuki 2017/02/10 07:47:21 A dictionary says: connect <=> disconnect asso
+ void unsetWrapperIfAny(ScriptWrappable* scriptWrappable) {
+ DCHECK(!m_isMainWorld);
+ m_wrapperMap->removeIfAny(scriptWrappable);
+ }
+
bool setReturnValueFrom(v8::ReturnValue<v8::Value> returnValue,
ScriptWrappable* object) {
if (m_isMainWorld)
@@ -240,18 +246,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

Powered by Google App Engine
This is Rietveld 408576698