Chromium Code Reviews| 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()) |