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

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

Issue 1531443003: [bindings] Implement an ExperimentEnabled IDL extended attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Install interfaces/attributes/methods unconditionally. Use the generated ExperimentalFeature functi… Created 5 years 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/attributes.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp b/third_party/WebKit/Source/bindings/templates/attributes.cpp
index b7fdd10e8bdf20951dcd8069be2520ed2801dbea..6991c14d989222411137c8cf30a37247603c43fa 100644
--- a/third_party/WebKit/Source/bindings/templates/attributes.cpp
+++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp
@@ -1,5 +1,5 @@
{% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_local_cpp_value %}
-
+{% from 'api_experiment.cpp' import check_api_experiment %}
{##############################################################################}
{% macro attribute_getter(attribute, world_suffix) %}
@@ -11,6 +11,9 @@ const v8::PropertyCallbackInfo<v8::Value>& info
const v8::FunctionCallbackInfo<v8::Value>& info
{%- endif %})
{
+ {% filter trim %}
haraken 2015/12/30 00:25:32 Why is trim needed?
Daniel Nishi 2015/12/30 22:05:50 I was having spacing issues because the macro was
+ {{check_api_experiment(attribute) | indent}}
+ {% endfilter %}
{% if attribute.is_reflect and not attribute.is_url
and attribute.idl_type == 'DOMString' and is_node
and not attribute.is_implemented_in_private_script %}
@@ -178,6 +181,9 @@ const v8::FunctionCallbackInfo<v8::Value>& info
{% if attribute.measure_as %}
UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}});
{% endif %}
+ {% filter trim %}
+ {{check_api_experiment(attribute) | indent}}
+ {% endfilter %}
{% if world_suffix in attribute.activity_logging_world_list_for_getter %}
ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext());
V8PerContextData* contextData = scriptState->perContextData();
@@ -211,6 +217,9 @@ static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Loca
{% if attribute.measure_as %}
UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as('ConstructorGetter')}});
{% endif %}
+ {% filter trim %}
+ {{check_api_experiment(attribute) | indent}}
+ {% endfilter %}
v8ConstructorAttributeGetter(property, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
@@ -418,6 +427,10 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeGetter(LocalFrame*
if (holder.IsEmpty())
return false;
+ {% filter trim %}
+ {{check_api_experiment(attribute) | indent}}
+ {% endfilter %}
+
ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.name}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate());
v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "{{cpp_class}}", "{{attribute.name}}", holder);
if (v8Value.IsEmpty())

Powered by Google App Engine
This is Rietveld 408576698