Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/templates/utilities.cpp |
| diff --git a/third_party/WebKit/Source/bindings/templates/utilities.cpp b/third_party/WebKit/Source/bindings/templates/utilities.cpp |
| index 7f759451c7be673f3470fc20b7b8469cf318a546..cf6c14706fdc4e2c7a1a850967fc130b3686a69e 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/utilities.cpp |
| +++ b/third_party/WebKit/Source/bindings/templates/utilities.cpp |
| @@ -53,3 +53,23 @@ const char* validValues[] = { |
| {% endif %} |
| {{property_location_list | join(' | ')}} |
| {%- endmacro %} |
| + |
| + |
| +{% macro check_api_experiment_internal(errorName, experiment_name) %} |
| +{% if experiment_name %} |
| +String {{errorName}}; |
| +if (!{{experiment_name}}(executionContextFromIsolate, {{errorName}})) { |
| + v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); |
| + Document& document = *toDocument(executionContextFromIsolate); |
| + document.addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, {{errorName}})); |
|
haraken
2015/12/31 12:47:22
toDocument(executionContextFromIsolate).addConsole
Daniel Nishi
2016/01/04 18:56:31
Done.
|
| + return; |
| +} |
| +{% endif %} |
| +{% endmacro %} |
| + |
| + |
| +{% macro check_api_experiment(member, isolate="info.GetIsolate()") -%} |
| +ExecutionContext* executionContextFromIsolate = currentExecutionContext({{isolate}}); |
|
haraken
2015/12/31 12:47:22
executionContextFromIsolate => executionContext (o
Daniel Nishi
2016/01/04 18:56:31
Done.
|
| +{{check_api_experiment_internal("errorMessage", member.api_experiment_enabled_per_interface) -}} |
| +{{check_api_experiment_internal("memberErrorMessage", member.api_experiment_enabled) -}} |
| +{% endmacro %} |