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

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

Issue 1944363002: Use a new type of weak phantom handle for ScriptWrappable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/ScriptWrappable.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
index 31597a055943bbbb7ed536f12639719273fd29e9..db38c708512fb37bf12e5b7afb2235f2fdc77502 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
@@ -105,7 +105,7 @@ public:
}
m_wrapper.Reset(isolate, wrapper);
wrapperTypeInfo->configureWrapper(&m_wrapper);
- m_wrapper.SetWeak(this, &firstWeakCallback, v8::WeakCallbackType::kInternalFields);
+ m_wrapper.SetWeak();
ASSERT(containsWrapper());
return true;
}
@@ -169,23 +169,6 @@ public:
// already broken), we must not hit the RELEASE_ASSERT.
private:
- void disposeWrapper(const v8::WeakCallbackInfo<ScriptWrappable>& data)
- {
- auto scriptWrappable = reinterpret_cast<ScriptWrappable*>(data.GetInternalField(v8DOMWrapperObjectIndex));
- SECURITY_CHECK(scriptWrappable == this);
- RELEASE_ASSERT(containsWrapper());
- m_wrapper.Reset();
- }
-
- static void firstWeakCallback(const v8::WeakCallbackInfo<ScriptWrappable>& data)
- {
- auto scriptWrappable = data.GetParameter();
- scriptWrappable->disposeWrapper(data);
-
- auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>(data.GetInternalField(v8DOMWrapperTypeIndex));
- wrapperTypeInfo->wrapperDestroyed();
- }
-
v8::Persistent<v8::Object> m_wrapper;
};

Powered by Google App Engine
This is Rietveld 408576698