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

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

Issue 725163002: bindings: Retires V8T::toEventTarget and reduces the binary size. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made bitfields be type of unsigned to support both of MSVC and Android. Created 6 years, 1 month 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
« no previous file with comments | « Source/bindings/core/v8/NPV8Object.cpp ('k') | Source/bindings/core/v8/WrapperTypeInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/WrapperTypeInfo.h
diff --git a/Source/bindings/core/v8/WrapperTypeInfo.h b/Source/bindings/core/v8/WrapperTypeInfo.h
index 5df98ca646a6748ec19e379874ad7ec998fbb208..b017a591c53831a966afb08ac09a7ea980742275 100644
--- a/Source/bindings/core/v8/WrapperTypeInfo.h
+++ b/Source/bindings/core/v8/WrapperTypeInfo.h
@@ -53,7 +53,6 @@ typedef void (*RefObjectFunction)(ScriptWrappableBase*);
typedef void (*DerefObjectFunction)(ScriptWrappableBase*);
typedef void (*TraceFunction)(Visitor*, ScriptWrappableBase*);
typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>);
-typedef EventTarget* (*ToEventTargetFunction)(v8::Handle<v8::Object>);
typedef void (*ResolveWrapperReachabilityFunction)(v8::Isolate*, ScriptWrappableBase*, const v8::Persistent<v8::Object>&);
typedef void (*InstallConditionallyEnabledMethodsFunction)(v8::Handle<v8::Object>, v8::Isolate*);
typedef void (*InstallConditionallyEnabledPropertiesFunction)(v8::Handle<v8::Object>, v8::Isolate*);
@@ -77,6 +76,11 @@ struct WrapperTypeInfo {
ObjectClassId,
};
+ enum EventTargetInheritance {
+ NotInheritFromEventTarget,
+ InheritFromEventTarget,
+ };
+
enum Lifetime {
Dependent,
Independent,
@@ -93,7 +97,6 @@ struct WrapperTypeInfo {
return reinterpret_cast<const WrapperTypeInfo*>(v8::External::Cast(*typeInfoWrapper)->Value());
}
-
bool equals(const WrapperTypeInfo* that) const
{
return this == that;
@@ -158,12 +161,7 @@ struct WrapperTypeInfo {
return toActiveDOMObjectFunction(object);
}
- EventTarget* toEventTarget(v8::Handle<v8::Object> object) const
- {
- if (!toEventTargetFunction)
- return 0;
- return toEventTargetFunction(object);
- }
+ EventTarget* toEventTarget(v8::Handle<v8::Object>) const;
void visitDOMWrapper(v8::Isolate* isolate, ScriptWrappableBase* scriptWrappableBase, const v8::Persistent<v8::Object>& wrapper) const
{
@@ -181,15 +179,15 @@ struct WrapperTypeInfo {
const DerefObjectFunction derefObjectFunction;
const TraceFunction traceFunction;
const ToActiveDOMObjectFunction toActiveDOMObjectFunction;
- const ToEventTargetFunction toEventTargetFunction;
const ResolveWrapperReachabilityFunction visitDOMWrapperFunction;
InstallConditionallyEnabledMethodsFunction installConditionallyEnabledMethodsFunction;
const InstallConditionallyEnabledPropertiesFunction installConditionallyEnabledPropertiesFunction;
const WrapperTypeInfo* parentClass;
- const WrapperTypePrototype wrapperTypePrototype;
- const WrapperClassId wrapperClassId;
- const Lifetime lifetime;
- const GCType gcType;
+ const unsigned wrapperTypePrototype : 1; // WrapperTypePrototype
+ const unsigned wrapperClassId : 2; // WrapperClassId
+ const unsigned eventTargetInheritance : 1; // EventTargetInheritance
+ const unsigned lifetime : 1; // Lifetime
+ const unsigned gcType : 2; // GCType
};
COMPILE_ASSERT(offsetof(struct WrapperTypeInfo, ginEmbedder) == offsetof(struct gin::WrapperInfo, embedder), wrapper_type_info_compatible_to_gin);
« no previous file with comments | « Source/bindings/core/v8/NPV8Object.cpp ('k') | Source/bindings/core/v8/WrapperTypeInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698