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 89604a191368913c98024872a6205b5d2d9ea3b4..d36c5b5060170c129167f92fc4e43458365ee19b 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/attributes.cpp |
| +++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp |
| @@ -11,6 +11,13 @@ const v8::PropertyCallbackInfo<v8::Value>& info |
| const v8::FunctionCallbackInfo<v8::Value>& info |
| {%- endif %}) |
| { |
| + {% if attribute.experimental_api_name %} |
| + String errorMessage; |
|
haraken
2015/12/16 02:16:41
What is this errorMessage for?
Daniel Nishi
2015/12/16 21:42:02
It explains why an experiment may have failed.
Wh
|
| + if (!Experiments::isApiEnabled(currentExecutionContext(info.GetIsolate()), "{{ attribute.experimental_api_name }}", errorMessage)) { |
|
haraken
2015/12/16 02:16:41
Do you have a CL to implement the isAPIEnabled?
I
Daniel Nishi
2015/12/16 21:42:02
https://code.google.com/p/chromium/codesearch#chro
|
| + v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); |
| + return; |
| + } |
| + {% endif %} |
| {% 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 %} |
| @@ -468,7 +475,7 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame* |
| {% set getter_callback = |
| '%sV8Internal::%sConstructorGetterCallback' % (cpp_class_or_partial, attribute.name) |
| if attribute.needs_constructor_getter_callback else |
| - 'v8ConstructorAttributeGetter' %} |
| + 'is%sExperimentallyEnabled' % attribute.name if attribute.experimental_api_name else 'v8ConstructorAttributeGetter' %} |
|
haraken
2015/12/16 02:16:41
Avoid using "if ... else ... if ... else".
Daniel Nishi
2015/12/16 21:42:02
I've removed this by eliminating is%sExperimentall
|
| {% set setter_callback = |
| '%sV8Internal::%sAttributeSetterCallback' % (cpp_class_or_partial, attribute.name) |
| if attribute.needs_constructor_setter_callback else |