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

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

Issue 2045453002: Refactor WrapperTypeInfo.traceWrappers to WrapperTypeInfo.getHeader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use nicer name Created 4 years, 6 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/WrapperTypeInfo.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
index 64d7713f57663580374c8d439c0b2f17a8719beb..79aaf2324f53bbe76b85be899a02cd4efacba4d9 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
+++ b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
@@ -53,8 +53,8 @@ static const int v8PrototypeTypeIndex = 0;
static const int v8PrototypeInternalFieldcount = 1;
typedef v8::Local<v8::FunctionTemplate> (*DomTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&);
+typedef HeapObjectHeader* (*GetHeaderFunction)(ScriptWrappable*);
typedef void (*TraceFunction)(Visitor*, ScriptWrappable*);
-typedef void (*TraceWrappersFunction)(WrapperVisitor*, ScriptWrappable*);
typedef ActiveScriptWrappable* (*ToActiveScriptWrappableFunction)(v8::Local<v8::Object>);
typedef void (*ResolveWrapperReachabilityFunction)(v8::Isolate*, ScriptWrappable*, const v8::Persistent<v8::Object>&);
typedef void (*PreparePrototypeAndInterfaceObjectFunction)(v8::Local<v8::Context>, const DOMWrapperWorld&, v8::Local<v8::Object>, v8::Local<v8::Function>, v8::Local<v8::FunctionTemplate>);
@@ -134,16 +134,16 @@ struct WrapperTypeInfo {
heapStats.increaseCollectedWrapperCount(1);
}
- void trace(Visitor* visitor, ScriptWrappable* scriptWrappable) const
+ HeapObjectHeader* getHeader(ScriptWrappable* scriptWrappable) const
{
- ASSERT(traceFunction);
- return traceFunction(visitor, scriptWrappable);
+ DCHECK(getHeaderFunction);
+ return getHeaderFunction(scriptWrappable);
}
- void traceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) const
+ void trace(Visitor* visitor, ScriptWrappable* scriptWrappable) const
{
- ASSERT(traceWrappersFunction);
- return traceWrappersFunction(visitor, scriptWrappable);
+ DCHECK(traceFunction);
+ return traceFunction(visitor, scriptWrappable);
}
void preparePrototypeAndInterfaceObject(v8::Local<v8::Context> context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) const
@@ -184,8 +184,8 @@ struct WrapperTypeInfo {
const gin::GinEmbedder ginEmbedder;
DomTemplateFunction domTemplateFunction;
+ const GetHeaderFunction getHeaderFunction;
const TraceFunction traceFunction;
- const TraceWrappersFunction traceWrappersFunction;
const ToActiveScriptWrappableFunction toActiveScriptWrappableFunction;
const ResolveWrapperReachabilityFunction visitDOMWrapperFunction;
PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfaceObjectFunction;

Powered by Google App Engine
This is Rietveld 408576698