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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestTraceWrapperReferences.cpp

Issue 1876383003: Introduce infrastructure for tracing ScriptWrappables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to traceActiveScriptWrappables - C++ is happier 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/tests/results/core/V8TestTraceWrapperReferences.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTraceWrapperReferences.cpp
similarity index 50%
copy from third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp
copy to third_party/WebKit/Source/bindings/tests/results/core/V8TestTraceWrapperReferences.cpp
index c712e3a67858e9232f46fb2183cc855251a5a002..757ee695604af780c088eddeafb5852e1bd8c606 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTraceWrapperReferences.cpp
@@ -4,9 +4,10 @@
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
-#include "V8TestInterfaceEmpty.h"
+#include "V8TestTraceWrapperReferences.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/ScriptWrappableVisitor.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
#include "core/dom/Document.h"
@@ -21,24 +22,33 @@ namespace blink {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
-const WrapperTypeInfo V8TestInterfaceEmpty::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEmpty::domTemplate, V8TestInterfaceEmpty::trace, 0, 0, V8TestInterfaceEmpty::preparePrototypeAndInterfaceObject, V8TestInterfaceEmpty::installConditionallyEnabledProperties, "TestInterfaceEmpty", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Independent };
+const WrapperTypeInfo V8TestTraceWrapperReferences::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestTraceWrapperReferences::domTemplate, V8TestTraceWrapperReferences::trace, 0, 0, V8TestTraceWrapperReferences::preparePrototypeAndInterfaceObject, V8TestTraceWrapperReferences::installConditionallyEnabledProperties, "TestTraceWrapperReferences", &V8Node::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTypeInfo::InheritFromEventTarget, WrapperTypeInfo::Dependent };
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic pop
#endif
-// This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfaceEmpty.h.
+// This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestTraceWrapperReferences.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// bindings/core/v8/ScriptWrappable.h.
-const WrapperTypeInfo& TestInterfaceEmpty::s_wrapperTypeInfo = V8TestInterfaceEmpty::wrapperTypeInfo;
+const WrapperTypeInfo& TestTraceWrapperReferences::s_wrapperTypeInfo = V8TestTraceWrapperReferences::wrapperTypeInfo;
-namespace TestInterfaceEmptyV8Internal {
+namespace TestTraceWrapperReferencesV8Internal {
-} // namespace TestInterfaceEmptyV8Internal
+} // namespace TestTraceWrapperReferencesV8Internal
-static void installV8TestInterfaceEmptyTemplate(v8::Local<v8::FunctionTemplate> interfaceTemplate, v8::Isolate* isolate)
+DEFINE_TRACE_WRAPPERS(TestTraceWrapperReferences)
+{
+ visitor->traceWrappers(firstChild());
+ visitor->traceWrappers(nextSibling());
+ visitor->traceWrappers(prevSibling());
+ visitor->traceWrappers(parent());
+
+ Node::traceWrappers(visitor);
+}
+static void installV8TestTraceWrapperReferencesTemplate(v8::Local<v8::FunctionTemplate> interfaceTemplate, v8::Isolate* isolate)
{
// Initialize the interface object's template.
- V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestInterfaceEmpty::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTemplate>(), V8TestInterfaceEmpty::internalFieldCount);
+ V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestTraceWrapperReferences::wrapperTypeInfo.interfaceName, V8Node::domTemplate(isolate), V8TestTraceWrapperReferences::internalFieldCount);
v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
ALLOW_UNUSED_LOCAL(signature);
v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
@@ -49,22 +59,22 @@ static void installV8TestInterfaceEmptyTemplate(v8::Local<v8::FunctionTemplate>
}
-v8::Local<v8::FunctionTemplate> V8TestInterfaceEmpty::domTemplate(v8::Isolate* isolate)
+v8::Local<v8::FunctionTemplate> V8TestTraceWrapperReferences::domTemplate(v8::Isolate* isolate)
{
- return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceEmptyTemplate);
+ return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestTraceWrapperReferencesTemplate);
}
-bool V8TestInterfaceEmpty::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
+bool V8TestTraceWrapperReferences::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
}
-v8::Local<v8::Object> V8TestInterfaceEmpty::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
+v8::Local<v8::Object> V8TestTraceWrapperReferences::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
}
-TestInterfaceEmpty* V8TestInterfaceEmpty::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
+TestTraceWrapperReferences* V8TestTraceWrapperReferences::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
{
return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0;
}

Powered by Google App Engine
This is Rietveld 408576698