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

Unified Diff: third_party/WebKit/Source/bindings/templates/interface_base.cpp

Issue 2005433002: [Origin Trials] Install origin trial bindings on V8 context conditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-ef-install
Patch Set: Clean up Created 4 years, 7 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/templates/interface_base.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
index abd7ca3320ecfc0a6755172837a200020ebe2a8a..2463b3a3d2f1ecfaee0ad3fdac51881496391fee 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
@@ -365,6 +365,28 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo
{% endif %}{# not is_array_buffer_or_view #}
{% endblock %}
{##############################################################################}
+{% block origin_trials %}
+{% from 'attributes.cpp' import attribute_configuration with context %}
+{% for group in attributes|origin_trial_enabled_attributes|groupby('origin_trial_feature_name') %}{{newline}}
+void {{v8_class_or_partial}}::install{{group.grouper}}(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::Object> instance, v8::Local<v8::Function> interface)
haraken 2016/05/27 00:01:42 Sorry, I got lost. Who calls the install methods?
iclelland 2016/05/27 03:19:43 These are called by the installOriginTrialsFor{Cor
haraken 2016/05/27 22:25:17 installOriginTrialsForCore doesn't call any instal
iclelland 2016/05/30 12:15:35 Yes, that's correct. Currently, the only origin tr
+{
+ v8::Local<v8::Signature> signature;
+ v8::Local<v8::Object> prototype = instance->GetPrototype()->ToObject(isolate);
+ {% for attribute in group.list | unique_by('name') | sort %}
+ {% if attribute.is_data_type_property %}
+ const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Configuration = \
+ {{attribute_configuration(attribute)}};
+ V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attribute{{attribute.name}}Configuration);
+ {% else %}
+ const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration = \
+ {{attribute_configuration(attribute)}};
+ V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, interface, signature, accessor{{attribute.name}}Configuration);
+ {% endif %}
+ {% endfor %}
+}
+{% endfor %}
+{% endblock %}
+{##############################################################################}
{% block get_dom_template %}{% endblock %}
{% block get_dom_template_for_named_properties_object %}{% endblock %}
{% block has_instance %}{% endblock %}

Powered by Google App Engine
This is Rietveld 408576698