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

Unified Diff: Source/bindings/templates/interface.cpp

Issue 1202683002: bindings: Supports per-member [Exposed] for attributes on prototype. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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: Source/bindings/templates/interface.cpp
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index 5b1a9fde3edca9d0726e5ed8e36f9de5d6b679c4..0577cc3c8b4149a88315ae1f28a11b795ededda0 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -797,24 +797,10 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V
{##############################################################################}
{% block install_conditional_attributes %}
{% from 'attributes.cpp' import attribute_configuration with context %}
-{% if has_conditional_attributes %}
+{% if has_conditional_attributes_on_instance %}
void {{v8_class}}::installConditionallyEnabledProperties(v8::Local<v8::Object> instanceObject, v8::Isolate* isolate)
{
- v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instanceObject->GetPrototype());
- ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext());
-
- {% for attribute in attributes if attribute.exposed_test %}
- {% filter exposed(attribute.exposed_test) %}
-#error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
-// TODO(yukishiino): Implement the feature again if there is a client.
- {% endfilter %}
- {% endfor %}
- {% for method in methods if method.exposed_test %}
- {% filter exposed(method.exposed_test) %}
-#error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
-// TODO(yukishiino): Implement the feature again if there is a client.
- {% endfilter %}
- {% endfor %}
+#error TODO(yukishiino): Rename this function to prepareInstanceObject (c.f. preparePrototypeObject) and implement this function if necessary.
bashi 2015/06/23 08:21:03 Crbug number?
Yuki 2015/06/23 08:36:05 Done.
}
{% endif %}
@@ -823,13 +809,25 @@ void {{v8_class}}::installConditionallyEnabledProperties(v8::Local<v8::Object> i
{##############################################################################}
{% block prepare_prototype_object %}
+{% from 'attributes.cpp' import attribute_configuration with context %}
{% from 'methods.cpp' import install_conditionally_enabled_methods with context %}
-{% if unscopeables or conditionally_enabled_methods %}
-void {{v8_class}}::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8::Object> prototypeObject)
+{% if has_conditional_member_on_prototype %}
+void {{v8_class}}::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8::Object> prototypeObject, v8::Local<v8::FunctionTemplate> interfaceTemplate)
{
{% if unscopeables %}
{{install_unscopeables() | indent}}
{% endif %}
+{% if has_conditional_attributes_on_prototype %}
+ ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext());
+ v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
+
+ {% for attribute in attributes if attribute.exposed_test and attribute.on_prototype %}
+ {% filter exposed(attribute.exposed_test) %}
+ static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attribute_configuration(attribute)}};
+ V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), prototypeObject, v8::Local<v8::Function>(), signature, accessorConfiguration);
+ {% endfilter %}
+ {% endfor %}
+{% endif %}
{% if conditionally_enabled_methods %}
{{install_conditionally_enabled_methods() | indent}}
{% endif %}

Powered by Google App Engine
This is Rietveld 408576698