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

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..e0570cf23d106ea619dfc37f0c38b2f16b620163 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
+++ b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
@@ -31,6 +31,7 @@
#ifndef WrapperTypeInfo_h
#define WrapperTypeInfo_h
+#include "bindings/core/v8/ActiveScriptWrappable.h"
#include "gin/public/wrapper_info.h"
#include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
@@ -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,18 @@ struct WrapperTypeInfo {
installConditionallyEnabledPropertiesFunction(prototypeObject, isolate);
}
+ ActiveScriptWrappable* toActiveScriptWrappable(v8::Local<v8::Object> object) const
+ {
+ if (!toActiveScriptWrappableFunction)
+ return nullptr;
+ return toActiveScriptWrappableFunction(object);
+ }
+
+ bool hasPendingActivity(v8::Local<v8::Object> object) const
+ {
+ return !toActiveScriptWrappableFunction ? false : toActiveScriptWrappableFunction(object)->hasPendingActivity();
+ }
+
EventTarget* toEventTarget(v8::Local<v8::Object>) const;
void visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* scriptWrappable, const v8::Persistent<v8::Object>& wrapper) const
@@ -198,6 +212,7 @@ struct WrapperTypeInfo {
const RefObjectFunction refObjectFunction;
const DerefObjectFunction derefObjectFunction;
const TraceFunction traceFunction;
+ const ToActiveScriptWrappableFunction toActiveScriptWrappableFunction;
const ResolveWrapperReachabilityFunction visitDOMWrapperFunction;
PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfaceObjectFunction;
const InstallConditionallyEnabledPropertiesFunction installConditionallyEnabledPropertiesFunction;

Powered by Google App Engine
This is Rietveld 408576698