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

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

Issue 1890733002: Make code generator understand FrozenArray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 5d776a7172c563d978594851d86f0b59588d4288..f87d44c2d0afa46d7b4900f6fdd9c82abb17ac45 100644
--- a/third_party/WebKit/Source/bindings/scripts/idl_types.py
+++ b/third_party/WebKit/Source/bindings/scripts/idl_types.py
@@ -10,6 +10,7 @@ IdlTypeBase
IdlArrayOrSequenceType
IdlArrayType
IdlSequenceType
+ IdlFrozenArrayType
IdlNullableType
IdlTypes are picklable because we store them in interfaces_info.
@@ -334,11 +335,12 @@ class IdlUnionType(IdlTypeBase):
################################################################################
-# IdlArrayOrSequenceType, IdlArrayType, IdlSequenceType
+# IdlArrayOrSequenceType, IdlArrayType, IdlSequenceType, IdlFrozenArrayType
################################################################################
+# TODO(bashi): Rename this like "IdlArrayTypeBase" or something.
class IdlArrayOrSequenceType(IdlTypeBase):
- """Base class for IdlArrayType and IdlSequenceType."""
+ """Base class for array-like types."""
def __init__(self, element_type):
super(IdlArrayOrSequenceType, self).__init__()
@@ -398,6 +400,19 @@ class IdlSequenceType(IdlArrayOrSequenceType):
return self.element_type.name + 'Sequence'
+class IdlFrozenArrayType(IdlArrayOrSequenceType):
+ def __init__(self, element_type):
+ super(IdlFrozenArrayType, self).__init__(element_type)
+
+ def __str__(self):
+ return 'FrozenArray<%s>' % self.element_type
+
+ @property
+ def name(self):
+ return self.element_type.name + 'Array'
+
+
+
################################################################################
# IdlNullableType
################################################################################
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/idl_definitions.py ('k') | third_party/WebKit/Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698