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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/idl_definitions.py

Issue 1901983002: IDL: Merge stringifier/serializer definition from implemented interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: as a test, move defs from TestInterface to TestImplements 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/idls/core/TestImplements.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 if self.stringifier.attribute: 380 if self.stringifier.attribute:
381 self.attributes.append(self.stringifier.attribute) 381 self.attributes.append(self.stringifier.attribute)
382 elif self.stringifier.operation: 382 elif self.stringifier.operation:
383 self.operations.append(self.stringifier.operation) 383 self.operations.append(self.stringifier.operation)
384 384
385 def merge(self, other): 385 def merge(self, other):
386 """Merge in another interface's members (e.g., partial interface)""" 386 """Merge in another interface's members (e.g., partial interface)"""
387 self.attributes.extend(other.attributes) 387 self.attributes.extend(other.attributes)
388 self.constants.extend(other.constants) 388 self.constants.extend(other.constants)
389 self.operations.extend(other.operations) 389 self.operations.extend(other.operations)
390 if self.serializer is None:
391 self.serializer = other.serializer
392 if self.stringifier is None:
393 self.stringifier = other.stringifier
390 394
391 395
392 class IdlException(IdlInterface): 396 class IdlException(IdlInterface):
393 # Properly exceptions and interfaces are distinct, and thus should inherit a 397 # Properly exceptions and interfaces are distinct, and thus should inherit a
394 # common base class (say, "IdlExceptionOrInterface"). 398 # common base class (say, "IdlExceptionOrInterface").
395 # However, there is only one exception (DOMException), and new exceptions 399 # However, there is only one exception (DOMException), and new exceptions
396 # are not expected. Thus it is easier to implement exceptions as a 400 # are not expected. Thus it is easier to implement exceptions as a
397 # restricted subclass of interfaces. 401 # restricted subclass of interfaces.
398 # http://www.w3.org/TR/WebIDL/#idl-exceptions 402 # http://www.w3.org/TR/WebIDL/#idl-exceptions
399 def __init__(self, idl_name, node): 403 def __init__(self, idl_name, node):
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 self.visit_typed_object(argument) 1111 self.visit_typed_object(argument)
1108 1112
1109 def visit_iterable(self, iterable): 1113 def visit_iterable(self, iterable):
1110 self.visit_typed_object(iterable) 1114 self.visit_typed_object(iterable)
1111 1115
1112 def visit_maplike(self, maplike): 1116 def visit_maplike(self, maplike):
1113 self.visit_typed_object(maplike) 1117 self.visit_typed_object(maplike)
1114 1118
1115 def visit_setlike(self, setlike): 1119 def visit_setlike(self, setlike):
1116 self.visit_typed_object(setlike) 1120 self.visit_typed_object(setlike)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/idls/core/TestImplements.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698