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

Unified Diff: third_party/WebKit/Source/bindings/scripts/code_generator.py

Issue 2880713002: Support combination of [OriginTrialEnabled] and [SecureContext] (Closed)
Patch Set: Remove workarounds Created 3 years, 7 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/scripts/code_generator.py
diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator.py b/third_party/WebKit/Source/bindings/scripts/code_generator.py
index e6e1764ed86e5f643d938b01051ccde0f2e80b93..157688761a4b92b2a128679ad065ab192af04a78 100644
--- a/third_party/WebKit/Source/bindings/scripts/code_generator.py
+++ b/third_party/WebKit/Source/bindings/scripts/code_generator.py
@@ -64,6 +64,11 @@ def secure_context_if(code, secure_context_test):
return generate_indented_conditional(code, 'executionContext && (%s)' % secure_context_test)
+def secure_context_cached_if(code, secure_context_test):
Yuki 2017/05/12 09:10:05 Hmm, I think *cached* in the name is not easy to u
chasej 2017/05/16 02:21:39 I agree on many points here. In an interim version
+ if not secure_context_test:
+ return code
+ return generate_indented_conditional(code, 'isSecureContext')
Yuki 2017/05/12 09:10:05 nit: s/isSecureContext/is_secure_context/
iclelland 2017/05/12 15:11:49 This looks like it matches surrounding code -- esp
Yuki 2017/05/12 15:14:11 Makes sense. I'm fine with either way.
+
# [RuntimeEnabled]
def runtime_enabled_if(code, name):
if not name:
@@ -72,7 +77,6 @@ def runtime_enabled_if(code, name):
function = v8_utilities.runtime_enabled_function(name)
return generate_indented_conditional(code, function)
-
def initialize_jinja_env(cache_dir):
jinja_env = jinja2.Environment(
loader=jinja2.FileSystemLoader(TEMPLATES_DIR),
@@ -90,6 +94,7 @@ def initialize_jinja_env(cache_dir):
'runtime_enabled': runtime_enabled_if,
'runtime_enabled_function': v8_utilities.runtime_enabled_function,
'secure_context': secure_context_if,
+ 'secure_context_cached': secure_context_cached_if,
'unique_by': unique_by})
jinja_env.filters.update(constant_filters())
jinja_env.filters.update(method_filters())

Powered by Google App Engine
This is Rietveld 408576698