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

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

Issue 425853006: Introduce V8DOMConfiguration::InstanceOrPrototype enum (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8DOMConfiguration.h
diff --git a/Source/bindings/core/v8/V8DOMConfiguration.h b/Source/bindings/core/v8/V8DOMConfiguration.h
index d2214261a2b135173c035e870267768806c74659..39056c2aa2ffad19b0874b54003621ce079a164a 100644
--- a/Source/bindings/core/v8/V8DOMConfiguration.h
+++ b/Source/bindings/core/v8/V8DOMConfiguration.h
@@ -48,8 +48,13 @@ public:
OnlyExposedToPrivateScript,
};
+ enum InstanceOrPrototypeConfiguration {
+ OnInstance,
+ OnPrototype,
+ };
+
// AttributeConfiguration translates into calls to SetAccessor() on either
- // the instance or the prototype ObjectTemplate, based on |onPrototype|.
+ // the instance or the prototype ObjectTemplate, based on |instanceOrPrototypeConfiguration|.
struct AttributeConfiguration {
const char* const name;
v8::AccessorGetterCallback getter;
@@ -60,7 +65,7 @@ public:
v8::AccessControl settings;
v8::PropertyAttribute attribute;
ExposeConfiguration exposeConfiguration;
- bool onPrototype;
+ InstanceOrPrototypeConfiguration instanceOrPrototypeConfiguration;
};
// AccessorConfiguration translates into calls to SetAccessorProperty()
@@ -94,7 +99,7 @@ public:
if (attribute.setterForMainWorld)
setter = attribute.setterForMainWorld;
}
- (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8AtomicString(isolate, attribute.name),
+ (attribute.instanceOrPrototypeConfiguration == OnPrototype ? prototype : instanceTemplate)->SetAccessor(v8AtomicString(isolate, attribute.name),
getter,
setter,
v8::External::New(isolate, const_cast<WrapperTypeInfo*>(attribute.data)),
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698