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

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

Issue 1861433002: Make [OriginTrialEnabled] and [RuntimeEnabled] mutually exclusive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@586594-separate-tests
Patch Set: Correct IDL for Web Bluetooth Created 4 years, 8 months 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 646484535e36ff0b3ec925edefea0fedeb2e75eb..4695997d86397cd8b09e8585bf6824f0a7dc4513 100644
--- a/third_party/WebKit/Source/bindings/templates/utilities.cpp
+++ b/third_party/WebKit/Source/bindings/templates/utilities.cpp
@@ -55,22 +55,14 @@ const char* validValues[] = {
{%- endmacro %}
-{% macro check_origin_trial_internal(errorName, origin_trial_name) %}
-{% if origin_trial_name %}
-String {{errorName}};
-if (!{{origin_trial_name}}(executionContext, {{errorName}})) {
+{% macro check_origin_trial(member, isolate="info.GetIsolate()") -%}
+ExecutionContext* executionContext = currentExecutionContext({{isolate}});
+String errorMessage;
+if (!{{member.origin_trial_enabled_function}}(executionContext, errorMessage)) {
v8SetReturnValue(info, v8::Undefined(info.GetIsolate()));
- if (!{{errorName}}.isEmpty()) {
- toDocument(executionContext)->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, {{errorName}}));
+ if (!errorMessage.isEmpty()) {
+ toDocument(executionContext)->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage));
}
return;
}
-{% endif %}
-{% endmacro %}
-
-
-{% macro check_origin_trial(member, isolate="info.GetIsolate()") -%}
-ExecutionContext* executionContext = currentExecutionContext({{isolate}});
-{{check_origin_trial_internal("errorMessage", member.origin_trial_enabled_per_interface) -}}
-{{check_origin_trial_internal("memberErrorMessage", member.origin_trial_enabled) -}}
{% endmacro %}

Powered by Google App Engine
This is Rietveld 408576698