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

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: Fix multiple definition of signature; addressing nits 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..cccec85afdba808fa77ec7bc4cf0f7940d2574e5 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
@@ -365,6 +365,29 @@ 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}}(ScriptState* scriptState, v8::Local<v8::Object> instance)
+{
+ v8::Local<v8::Object> prototype = instance->GetPrototype()->ToObject(scriptState->isolate());
+ v8::Local<v8::Signature> signature;
+ ALLOW_UNUSED_LOCAL(signature);
+ {% 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(scriptState->isolate(), scriptState->world(), instance, prototype, attribute{{attribute.name}}Configuration);
+ {% else %}
+ const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration = \
+ {{attribute_configuration(attribute)}};
+ V8DOMConfiguration::installAccessor(scriptState->isolate(), scriptState->world(), instance, prototype, v8::Local<v8::Function>(), 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 %}
« no previous file with comments | « third_party/WebKit/Source/bindings/templates/interface.h ('k') | third_party/WebKit/Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698