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

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

Issue 1531443003: [bindings] Implement an ExperimentEnabled IDL extended attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed. Much less added generations. 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/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 %}

Powered by Google App Engine
This is Rietveld 408576698