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

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

Issue 2408083003: Drop [ExperimentalCallbackFunction] (Closed)
Patch Set: Update tests and expectations Created 4 years, 2 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/idl_types.py
diff --git a/third_party/WebKit/Source/bindings/scripts/idl_types.py b/third_party/WebKit/Source/bindings/scripts/idl_types.py
index 12d1cf22ec5e7b104d8186609a30377cecb4c1a1..3224a5d84dee05d4bb734d959d531c1d4f3401fe 100644
--- a/third_party/WebKit/Source/bindings/scripts/idl_types.py
+++ b/third_party/WebKit/Source/bindings/scripts/idl_types.py
@@ -139,8 +139,7 @@ class IdlType(IdlTypeBase):
# FIXME: incorporate Nullable, etc.
# to support types like short?[] vs. short[]?, instead of treating these
# as orthogonal properties (via flags).
- callback_functions = set(STANDARD_CALLBACK_FUNCTIONS)
- experimental_callback_functions = {}
+ callback_functions = {}
callback_interfaces = set()
dictionaries = set()
enums = {} # name -> values
@@ -168,12 +167,19 @@ class IdlType(IdlTypeBase):
return self.base_type in BASIC_TYPES
@property
- def is_callback_function(self):
- return self.base_type in IdlType.callback_functions
+ def is_callback_function(self): # pylint: disable=C0103
+ return self.base_type in IdlType.callback_functions or self.base_type in STANDARD_CALLBACK_FUNCTIONS
@property
- def is_experimental_callback_function(self): # pylint: disable=C0103
- return self.base_type in IdlType.experimental_callback_functions
+ def is_custom_callback_function(self):
+ # Treat standard callback functions as custom as they aren't generated.
+ if self.base_type in STANDARD_CALLBACK_FUNCTIONS:
+ return True
+ entry = IdlType.callback_functions.get(self.base_type)
+ callback_function = entry.get('callback_function')
+ if not callback_function:
+ return False
+ return 'Custom' in callback_function.extended_attributes
@property
def is_callback_interface(self):
@@ -241,10 +247,6 @@ class IdlType(IdlTypeBase):
cls.callback_functions.update(new_callback_functions)
@classmethod
- def set_experimental_callback_functions(cls, new_callback_functions):
- cls.experimental_callback_functions.update(new_callback_functions)
-
- @classmethod
def set_callback_interfaces(cls, new_callback_interfaces):
cls.callback_interfaces.update(new_callback_interfaces)

Powered by Google App Engine
This is Rietveld 408576698