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

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

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 9 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 490eeac0b0b8c2150beadedeb6d9af5981162f64..5e6ab41b2bf9d81d49eb4e4d6f40dc1fc0e4bc52 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
+++ b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
@@ -39,6 +39,7 @@
namespace blink {
+class ActiveScriptWrappable;
class EventTarget;
class ScriptWrappable;
@@ -54,6 +55,7 @@ typedef v8::Local<v8::FunctionTemplate> (*DomTemplateFunction)(v8::Isolate*);
typedef void (*RefObjectFunction)(ScriptWrappable*);
typedef void (*DerefObjectFunction)(ScriptWrappable*);
typedef void (*TraceFunction)(Visitor*, 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>, v8::Local<v8::Object>, v8::Local<v8::Function>, v8::Local<v8::FunctionTemplate>);
typedef void (*InstallConditionallyEnabledPropertiesFunction)(v8::Local<v8::Object>, v8::Isolate*);
@@ -181,6 +183,13 @@ struct WrapperTypeInfo {
installConditionallyEnabledPropertiesFunction(prototypeObject, isolate);
}
+ ActiveScriptWrappable* toActiveScriptWrappable(v8::Local<v8::Object> object) const
+ {
+ if (!toActiveScriptWrappableFunction)
+ return nullptr;
+ return toActiveScriptWrappableFunction(object);
+ }
+
EventTarget* toEventTarget(v8::Local<v8::Object>) const;
void visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* scriptWrappable, const v8::Persistent<v8::Object>& wrapper) const
@@ -198,6 +207,7 @@ struct WrapperTypeInfo {
const RefObjectFunction refObjectFunction;
const DerefObjectFunction derefObjectFunction;
const TraceFunction traceFunction;
+ const ToActiveScriptWrappableFunction toActiveScriptWrappableFunction;
const ResolveWrapperReachabilityFunction visitDOMWrapperFunction;
PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfaceObjectFunction;
const InstallConditionallyEnabledPropertiesFunction installConditionallyEnabledPropertiesFunction;
@@ -234,6 +244,11 @@ inline ScriptWrappable* toScriptWrappable(v8::Local<v8::Object> wrapper)
return getInternalField<ScriptWrappable, v8DOMWrapperObjectIndex>(wrapper);
}
+inline ActiveScriptWrappable* toActiveScriptWrappable(v8::Local<v8::Object> wrapper)
+{
+ return getInternalField<WrapperTypeInfo, v8DOMWrapperTypeIndex>(wrapper)->toActiveScriptWrappable(wrapper);
+}
+
inline const WrapperTypeInfo* toWrapperTypeInfo(const v8::PersistentBase<v8::Object>& wrapper)
{
return getInternalField<WrapperTypeInfo, v8DOMWrapperTypeIndex>(wrapper);

Powered by Google App Engine
This is Rietveld 408576698