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

Unified Diff: Source/bindings/scripts/utilities.py

Issue 771323004: Expose Fetch API related classes to Window and WorkerGlobalScope. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@exposed-runtime-enabled
Patch Set: Created 6 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
« no previous file with comments | « Source/bindings/scripts/generate_global_constructors.py ('k') | Source/modules/serviceworkers/Headers.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/utilities.py
diff --git a/Source/bindings/scripts/utilities.py b/Source/bindings/scripts/utilities.py
index 9ea01d71e6c45ecc1cf7f07086303d1542c8cab8..5eb59a472a97dcd39bce5979b212c1382b63b86a 100644
--- a/Source/bindings/scripts/utilities.py
+++ b/Source/bindings/scripts/utilities.py
@@ -136,7 +136,7 @@ def is_callback_interface_from_idl(file_contents):
return bool(match)
-def get_interface_extended_attributes_from_idl(file_contents):
+def match_interface_extended_attributes_from_idl(file_contents):
# Strip comments
# re.compile needed b/c Python 2.6 doesn't support flags in re.sub
single_line_comment_re = re.compile(r'//.*$', flags=re.MULTILINE)
@@ -151,6 +151,11 @@ def get_interface_extended_attributes_from_idl(file_contents):
r'(:\s*\w+\s*)?'
r'{',
file_contents, flags=re.DOTALL)
+ return match
+
+
+def get_interface_extended_attributes_from_idl(file_contents):
+ match = match_interface_extended_attributes_from_idl(file_contents)
if not match:
return {}
@@ -166,3 +171,20 @@ def get_interface_extended_attributes_from_idl(file_contents):
name, _, value = map(string.strip, part.partition('='))
extended_attributes[name] = value
return extended_attributes
+
+
+def get_interface_exposed_arguments(file_contents):
+ match = match_interface_extended_attributes_from_idl(file_contents)
+ if not match:
+ return None
+
+ extended_attributes_string = match.group(1)
+ match = re.search(r'Exposed\(([^)]*)\)', file_contents, flags=re.DOTALL)
Jens Widell 2014/12/09 09:20:54 Put a "\b" before "Exposed", perhaps? In the unlik
+ if not match:
+ return None
+ arguments = []
+ for argument in map(string.strip, match.group(1).split(',')):
+ exposed, runtime_enabled = argument.split(' ')
+ arguments.append({'exposed': exposed, 'runtime_enabled': runtime_enabled})
+
+ return arguments
« no previous file with comments | « Source/bindings/scripts/generate_global_constructors.py ('k') | Source/modules/serviceworkers/Headers.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698