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

Unified Diff: sky/engine/bindings2/scripts/v8_utilities.py

Issue 914413004: Add a new bindings2/scripts directory for Dart bindings (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove idlrenderer.py it's not used Created 5 years, 10 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
« no previous file with comments | « sky/engine/bindings2/scripts/v8_types.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings2/scripts/v8_utilities.py
diff --git a/sky/engine/bindings/scripts/v8_utilities.py b/sky/engine/bindings2/scripts/v8_utilities.py
similarity index 72%
copy from sky/engine/bindings/scripts/v8_utilities.py
copy to sky/engine/bindings2/scripts/v8_utilities.py
index 37091e81c213abfb257d3af5c59481d50e3e1e7e..aec0c6b391776ac3014f545579a1831f3cf750e7 100644
--- a/sky/engine/bindings/scripts/v8_utilities.py
+++ b/sky/engine/bindings2/scripts/v8_utilities.py
@@ -46,11 +46,9 @@ ACRONYMS = [
'HTML',
'IME',
'JS',
- 'SVG',
'URL',
'WOFF',
'XML',
- 'XSLT',
]
@@ -128,8 +126,6 @@ IdlTypeBase.enum_validation_expression = property(enum_validation_expression)
def scoped_name(interface, definition, base_name):
- if 'ImplementedInPrivateScript' in definition.extended_attributes:
- return '%s::PrivateScript::%s' % (v8_class_name(interface), base_name)
# partial interfaces are implemented as separate classes, with their members
# implemented as static member functions
partial_interface_implemented_as = definition.extended_attributes.get('PartialInterfaceImplementedAs')
@@ -141,49 +137,10 @@ def scoped_name(interface, definition, base_name):
return 'impl->%s' % base_name
-def v8_class_name(interface):
- return v8_types.v8_type(interface.name)
-
-
################################################################################
# Specific extended attributes
################################################################################
-# [ActivityLogging]
-def activity_logging_world_list(member, access_type=''):
- """Returns a set of world suffixes for which a definition member has activity logging, for specified access type.
-
- access_type can be 'Getter' or 'Setter' if only checking getting or setting.
- """
- extended_attributes = member.extended_attributes
- if 'LogActivity' not in extended_attributes:
- return set()
- log_activity = extended_attributes['LogActivity']
- if log_activity and not log_activity.startswith(access_type):
- return set()
-
- includes.add('bindings/core/v8/V8DOMActivityLogger.h')
- if 'LogAllWorlds' in extended_attributes:
- return set(['', 'ForMainWorld'])
- return set(['']) # At minimum, include isolated worlds.
-
-
-# [ActivityLogging]
-def activity_logging_world_check(member):
- """Returns if an isolated world check is required when generating activity
- logging code.
-
- The check is required when there is no per-world binding code and logging is
- required only for isolated world.
- """
- extended_attributes = member.extended_attributes
- if 'LogActivity' not in extended_attributes:
- return False
- if ('PerWorldBindings' not in extended_attributes and
- 'LogAllWorlds' not in extended_attributes):
- return True
- return False
-
# [CallWith]
CALL_WITH_ARGUMENTS = {
@@ -213,28 +170,6 @@ def call_with_arguments(call_with_values):
if extended_attribute_value_contains(call_with_values, value)]
-# [Conditional]
-DELIMITER_TO_OPERATOR = {
- '|': '||',
- ',': '&&',
-}
-
-
-def conditional_string(definition_or_member):
- extended_attributes = definition_or_member.extended_attributes
- if 'Conditional' not in extended_attributes:
- return None
- return 'ENABLE(%s)' % extended_attributes['Conditional']
-
-
-# [DeprecateAs]
-def deprecate_as(member):
- extended_attributes = member.extended_attributes
- if 'DeprecateAs' not in extended_attributes:
- return None
- return extended_attributes['DeprecateAs']
-
-
# [Exposed]
EXPOSED_EXECUTION_CONTEXT_METHOD = {
'Window': 'isDocument',
@@ -274,26 +209,3 @@ def cpp_name(definition_or_member):
if 'ImplementedAs' not in extended_attributes:
return definition_or_member.name
return extended_attributes['ImplementedAs']
-
-
-# [MeasureAs]
-def measure_as(definition_or_member):
- extended_attributes = definition_or_member.extended_attributes
- if 'MeasureAs' not in extended_attributes:
- return None
- return extended_attributes['MeasureAs']
-
-
-# [RuntimeEnabled]
-def runtime_enabled_function_name(definition_or_member):
- """Returns the name of the RuntimeEnabledFeatures function.
-
- The returned function checks if a method/attribute is enabled.
- Given extended attribute RuntimeEnabled=FeatureName, return:
- RuntimeEnabledFeatures::{featureName}Enabled
- """
- extended_attributes = definition_or_member.extended_attributes
- if 'RuntimeEnabled' not in extended_attributes:
- return None
- feature_name = extended_attributes['RuntimeEnabled']
- return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
« no previous file with comments | « sky/engine/bindings2/scripts/v8_types.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698