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

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

Issue 2207423002: Implement '[SecureContext]' IDL attribute for interfaces, methods and attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback. Created 4 years, 4 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_v8.py
diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
index aed7e83656dbeb487fad60c1adf486494389559c..5104eeb67435d29b9be394225d945f984b2af2dd 100644
--- a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
+++ b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
@@ -427,6 +427,7 @@ def initialize_jinja_env(cache_dir):
'blink_capitalize': capitalize,
'exposed': exposed_if,
'for_origin_trial_feature': for_origin_trial_feature,
+ 'secure_context': secure_context_if,
'runtime_enabled': runtime_enabled_if,
'unique_by': unique_by,
})
@@ -451,6 +452,13 @@ def exposed_if(code, exposed_test):
return generate_indented_conditional(code, 'executionContext && (%s)' % exposed_test)
+# [SecureContext]
+def secure_context_if(code, secure_context_test):
+ if not secure_context_test:
+ return code
+ return generate_indented_conditional(code, 'executionContext && (%s)' % secure_context_test)
+
+
# [RuntimeEnabled]
def runtime_enabled_if(code, runtime_enabled_function_name):
if not runtime_enabled_function_name:

Powered by Google App Engine
This is Rietveld 408576698