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

Side by Side Diff: tools/dom/scripts/htmldartgenerator.py

Issue 23055008: Making almost all dom_ methods private. Exceptions will be addressed in a later CL. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « tools/dom/dom.json ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for the system to generate 6 """This module provides shared functionality for the system to generate
7 dart:html APIs from the IDL database.""" 7 dart:html APIs from the IDL database."""
8 8
9 import emitter 9 import emitter
10 from generator import AnalyzeOperation, ConstantOutputOrder, \ 10 from generator import AnalyzeOperation, ConstantOutputOrder, \
11 DartDomNameOfAttribute, FindMatchingAttribute, \ 11 DartDomNameOfAttribute, FindMatchingAttribute, \
12 TypeOrNothing, ConvertToFuture, GetCallbackInfo 12 TypeOrNothing, ConvertToFuture, GetCallbackInfo
13 from copy import deepcopy 13 from copy import deepcopy
14 from htmlrenamer import convert_to_future_members, keep_overloaded_members, \ 14 from htmlrenamer import convert_to_future_members, keep_overloaded_members, \
15 private_html_members, renamed_html_members, renamed_overloads, \ 15 private_html_members, dom_private_html_members, renamed_html_members, rename d_overloads, \
16 removed_html_members 16 removed_html_members
17 import logging 17 import logging
18 import monitored 18 import monitored
19 import sys 19 import sys
20 20
21 _logger = logging.getLogger('htmldartgenerator') 21 _logger = logging.getLogger('htmldartgenerator')
22 22
23 # Types that are accessible cross-frame in a limited fashion. 23 # Types that are accessible cross-frame in a limited fashion.
24 # In these cases, the base type (e.g., WindowBase) provides restricted access 24 # In these cases, the base type (e.g., WindowBase) provides restricted access
25 # while the subtype (e.g., Window) provides full access to the 25 # while the subtype (e.g., Window) provides full access to the
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 operation.id. If not, stop library generation, and throw an error, requiring 193 operation.id. If not, stop library generation, and throw an error, requiring
194 programmer input about the best name change before proceeding.""" 194 programmer input about the best name change before proceeding."""
195 operation_str = '%s.%s' % (interface.id, operation.id) 195 operation_str = '%s.%s' % (interface.id, operation.id)
196 if (operation.id in operations_by_name and 196 if (operation.id in operations_by_name and
197 len(operations_by_name[operation.id]) > 1 and 197 len(operations_by_name[operation.id]) > 1 and
198 len(filter(lambda overload: overload.startswith(operation_str), 198 len(filter(lambda overload: overload.startswith(operation_str),
199 renamed_overloads.keys())) == 0 and 199 renamed_overloads.keys())) == 0 and
200 operation_str not in keep_overloaded_members and 200 operation_str not in keep_overloaded_members and
201 operation_str not in renamed_html_members and 201 operation_str not in renamed_html_members and
202 operation_str not in private_html_members and 202 operation_str not in private_html_members and
203 operation_str not in dom_private_html_members and
203 operation_str not in removed_html_members and 204 operation_str not in removed_html_members and
204 operation.id != '__getter__' and 205 operation.id != '__getter__' and
205 operation.id != '__setter__' and 206 operation.id != '__setter__' and
206 operation.id != '__delete__'): 207 operation.id != '__delete__'):
207 _logger.error('Multiple type signatures for %s.%s' % ( 208 _logger.error('Multiple type signatures for %s.%s' % (
208 interface.id, operation.id)) 209 interface.id, operation.id))
209 raise Exception('Rename one of the methods in renamed_overloads or add it' 210 raise Exception('Rename one of the methods in renamed_overloads or add it'
210 ' to keep_overloaded_members.\n' 211 ' to keep_overloaded_members.\n'
211 'Generation UNsuccessful.') 212 'Generation UNsuccessful.')
212 213
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 if dart_name == 'Window': 664 if dart_name == 'Window':
664 return _secure_base_types[dart_name] 665 return _secure_base_types[dart_name]
665 return dart_name 666 return dart_name
666 667
667 def SecureBaseName(self, type_name): 668 def SecureBaseName(self, type_name):
668 if type_name in _secure_base_types: 669 if type_name in _secure_base_types:
669 return _secure_base_types[type_name] 670 return _secure_base_types[type_name]
670 671
671 def _DartType(self, type_name): 672 def _DartType(self, type_name):
672 return self._type_registry.DartType(type_name) 673 return self._type_registry.DartType(type_name)
OLDNEW
« no previous file with comments | « tools/dom/dom.json ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698