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

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

Issue 1873323002: Have bindings layer assume and insist that all interface types are GCed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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/V8DOMWrapper.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h b/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h
index 7f2fdd8d6e867479d114633a38bbf5204c2c9312..5cb815b89adabe528932c049ebe1f3ecb6dbb5f6 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h
@@ -59,7 +59,6 @@ public:
static v8::Local<v8::Object> associateObjectWithWrapper(v8::Isolate*, ScriptWrappable*, const WrapperTypeInfo*, v8::Local<v8::Object> wrapper) WARN_UNUSED_RETURN;
static v8::Local<v8::Object> associateObjectWithWrapper(v8::Isolate*, Node*, const WrapperTypeInfo*, v8::Local<v8::Object> wrapper) WARN_UNUSED_RETURN;
static void setNativeInfo(v8::Local<v8::Object>, const WrapperTypeInfo*, ScriptWrappable*);
- static void clearNativeInfo(v8::Local<v8::Object>, const WrapperTypeInfo*);
// hasInternalFieldsSet only checks if the value has the internal fields for
// wrapper obejct and type, and does not check if it's valid or not. The
// value may not be a Blink's wrapper object. In order to make sure of it,
@@ -76,20 +75,10 @@ inline void V8DOMWrapper::setNativeInfo(v8::Local<v8::Object> wrapper, const Wra
wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast<WrapperTypeInfo*>(wrapperTypeInfo));
}
-inline void V8DOMWrapper::clearNativeInfo(v8::Local<v8::Object> wrapper, const WrapperTypeInfo* wrapperTypeInfo)
-{
- ASSERT(wrapper->InternalFieldCount() >= 2);
- ASSERT(wrapperTypeInfo);
- // clearNativeInfo() is used only by NP objects, which are not garbage collected.
- ASSERT(wrapperTypeInfo->gcType == WrapperTypeInfo::RefCountedObject);
- wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast<WrapperTypeInfo*>(wrapperTypeInfo));
- wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, 0);
-}
-
inline v8::Local<v8::Object> V8DOMWrapper::associateObjectWithWrapper(v8::Isolate* isolate, ScriptWrappable* impl, const WrapperTypeInfo* wrapperTypeInfo, v8::Local<v8::Object> wrapper)
{
if (DOMDataStore::setWrapper(isolate, impl, wrapperTypeInfo, wrapper)) {
- wrapperTypeInfo->refObject(impl);
+ wrapperTypeInfo->wrapperCreated();
setNativeInfo(wrapper, wrapperTypeInfo, impl);
ASSERT(hasInternalFieldsSet(wrapper));
}
@@ -100,7 +89,7 @@ inline v8::Local<v8::Object> V8DOMWrapper::associateObjectWithWrapper(v8::Isolat
inline v8::Local<v8::Object> V8DOMWrapper::associateObjectWithWrapper(v8::Isolate* isolate, Node* node, const WrapperTypeInfo* wrapperTypeInfo, v8::Local<v8::Object> wrapper)
{
if (DOMDataStore::setWrapper(isolate, node, wrapperTypeInfo, wrapper)) {
- wrapperTypeInfo->refObject(ScriptWrappable::fromNode(node));
+ wrapperTypeInfo->wrapperCreated();
setNativeInfo(wrapper, wrapperTypeInfo, ScriptWrappable::fromNode(node));
ASSERT(hasInternalFieldsSet(wrapper));
}
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp ('k') | third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698