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

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

Issue 1744613003: Fixed more sdk/lib issues (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « tools/dom/scripts/dartgenerator.py ('k') | tools/dom/scripts/idlnode.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 # 2 #
3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 """Generates sdk/lib/_blink/dartium/_blink_dartium.dart file.""" 7 """Generates sdk/lib/_blink/dartium/_blink_dartium.dart file."""
8 8
9 import os 9 import os
10 10
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if argument.is_optional: 184 if argument.is_optional:
185 optional_default_args += 1 185 optional_default_args += 1
186 186
187 arg_count = len(param_infos) 187 arg_count = len(param_infos)
188 min_arg_count = arg_count - optional_default_args 188 min_arg_count = arg_count - optional_default_args
189 lb = min_arg_count - 2 if min_arg_count > 2 else 0 189 lb = min_arg_count - 2 if min_arg_count > 2 else 0
190 return (lb, arg_count + 1) 190 return (lb, arg_count + 1)
191 191
192 constructor_renames = { 192 constructor_renames = {
193 'RTCPeerConnection': 'webkitRTCPeerConnection', 193 'RTCPeerConnection': 'webkitRTCPeerConnection',
194 'SpeechRecognition': 'webkitSpeechRecognition',
194 } 195 }
195 196
196 def rename_constructor(name): 197 def rename_constructor(name):
197 return constructor_renames[name] if name in constructor_renames else name 198 return constructor_renames[name] if name in constructor_renames else name
198 199
199 def Generate_Blink(output_dir, database, type_registry): 200 def Generate_Blink(output_dir, database, type_registry):
200 blink_filename = os.path.join(output_dir, '_blink_dartium.dart') 201 blink_filename = os.path.join(output_dir, '_blink_dartium.dart')
201 blink_file = open(blink_filename, 'w') 202 blink_file = open(blink_filename, 'w')
202 203
203 blink_file.write(HEADER); 204 blink_file.write(HEADER);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 else: 322 else:
322 arguments = [] 323 arguments = []
323 for i in range(0, callback_index): 324 for i in range(0, callback_index):
324 arguments.append(ARGUMENT_NUM % i) 325 arguments.append(ARGUMENT_NUM % i)
325 argument_list = ', '.join(arguments) 326 argument_list = ', '.join(arguments)
326 if operation.is_static: 327 if operation.is_static:
327 class_property = CLASS_STATIC % interface.id 328 class_property = CLASS_STATIC % interface.id
328 blink_file.write(STATIC_OPERATION_ARGS % (name, callback_index, argument _list, class_property, name, argument_list)) 329 blink_file.write(STATIC_OPERATION_ARGS % (name, callback_index, argument _list, class_property, name, argument_list))
329 else: 330 else:
330 blink_file.write(OPERATION_ARGS % (name, callback_index, argument_list, name, argument_list)) 331 blink_file.write(OPERATION_ARGS % (name, callback_index, argument_list, name, argument_list))
OLDNEW
« no previous file with comments | « tools/dom/scripts/dartgenerator.py ('k') | tools/dom/scripts/idlnode.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698