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

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

Issue 2265873003: binding: Moves hasPendingActivity from ActiveScriptWrappable to ScriptWrappable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 04f72d7f1b343797e4d652640a24e8a71ffb7490..e654481aee501ed044d5d9cff0a67d95e6187b50 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
+++ b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
@@ -45,6 +45,7 @@ class EventTarget;
class ScriptWrappable;
ScriptWrappable* toScriptWrappable(const v8::PersistentBase<v8::Object>& wrapper);
+ScriptWrappable* toScriptWrappable(v8::Local<v8::Object> wrapper);
static const int v8DOMWrapperTypeIndex = static_cast<int>(gin::kWrapperInfoIndex);
static const int v8DOMWrapperObjectIndex = static_cast<int>(gin::kEncodedValueIndex);
@@ -70,6 +71,7 @@ inline void setObjectGroup(v8::Isolate* isolate, ScriptWrappable* scriptWrappabl
// comparing pointers is a safe way to determine if types match.
struct WrapperTypeInfo {
DISALLOW_NEW();
+
enum WrapperTypePrototype {
WrapperTypeObjectPrototype,
WrapperTypeExceptionPrototype,
@@ -80,6 +82,11 @@ struct WrapperTypeInfo {
ObjectClassId,
};
+ enum ActiveScriptWrappableInheritance {
+ NotInheritFromActiveScriptWrappable,
+ InheritFromActiveScriptWrappable,
+ };
+
enum EventTargetInheritance {
NotInheritFromEventTarget,
InheritFromEventTarget,
@@ -158,16 +165,9 @@ 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
+ bool isActiveScriptWrappable() const
{
- return !toActiveScriptWrappableFunction ? false : toActiveScriptWrappableFunction(object)->hasPendingActivity();
+ return activeScriptWrappableInheritance == InheritFromActiveScriptWrappable;
}
EventTarget* toEventTarget(v8::Local<v8::Object>) const;
@@ -180,13 +180,13 @@ struct WrapperTypeInfo {
visitDOMWrapperFunction(isolate, scriptWrappable, wrapper);
}
- // This field must be the first member of the struct WrapperTypeInfo. This is also checked by a static_assert() below.
+ // This field must be the first member of the struct WrapperTypeInfo.
+ // See also static_assert() in .cpp file.
const gin::GinEmbedder ginEmbedder;
DomTemplateFunction domTemplateFunction;
const TraceFunction traceFunction;
const TraceWrappersFunction traceWrappersFunction;
- const ToActiveScriptWrappableFunction toActiveScriptWrappableFunction;
const ResolveWrapperReachabilityFunction visitDOMWrapperFunction;
PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfaceObjectFunction;
const InstallConditionallyEnabledPropertiesFunction installConditionallyEnabledPropertiesFunction;
@@ -194,6 +194,7 @@ struct WrapperTypeInfo {
const WrapperTypeInfo* parentClass;
const unsigned wrapperTypePrototype : 1; // WrapperTypePrototype
const unsigned wrapperClassId : 2; // WrapperClassId
+ const unsigned activeScriptWrappableInheritance : 1; // ActiveScriptWrappableInheritance
const unsigned eventTargetInheritance : 1; // EventTargetInheritance
const unsigned lifetime : 1; // Lifetime
};

Powered by Google App Engine
This is Rietveld 408576698