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

Side by Side Diff: Source/bindings/scripts/v8_utilities.py

Issue 740453004: IDL: Basic dictionary inheritance support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 297
298 # [ImplementedAs] 298 # [ImplementedAs]
299 def cpp_name(definition_or_member): 299 def cpp_name(definition_or_member):
300 extended_attributes = definition_or_member.extended_attributes 300 extended_attributes = definition_or_member.extended_attributes
301 if 'ImplementedAs' not in extended_attributes: 301 if 'ImplementedAs' not in extended_attributes:
302 return definition_or_member.name 302 return definition_or_member.name
303 return extended_attributes['ImplementedAs'] 303 return extended_attributes['ImplementedAs']
304 304
305 305
306 def cpp_name_from_interfaces_info(name, interfaces_info):
307 return interfaces_info.get(name, {}).get('implemented_as') or name
Jens Widell 2014/11/19 06:41:47 Pass 'name' as the default, to the second get()?
bashi 2014/11/19 07:35:22 It seems that get() returns None when the associat
Jens Widell 2014/11/19 07:38:53 Ah, yes, it does. Let's not pass 'name' as the de
308
309
306 def cpp_name_or_partial(interface): 310 def cpp_name_or_partial(interface):
307 cpp_class_name = cpp_name(interface) 311 cpp_class_name = cpp_name(interface)
308 if interface.is_partial: 312 if interface.is_partial:
309 return ''.join([cpp_class_name, 'Partial']) 313 return ''.join([cpp_class_name, 'Partial'])
310 return cpp_class_name 314 return cpp_class_name
311 315
312 316
313 # [MeasureAs] 317 # [MeasureAs]
314 def measure_as(definition_or_member): 318 def measure_as(definition_or_member):
315 extended_attributes = definition_or_member.extended_attributes 319 extended_attributes = definition_or_member.extended_attributes
(...skipping 18 matching lines...) Expand all
334 338
335 The returned function checks if a method/attribute is enabled. 339 The returned function checks if a method/attribute is enabled.
336 Given extended attribute RuntimeEnabled=FeatureName, return: 340 Given extended attribute RuntimeEnabled=FeatureName, return:
337 RuntimeEnabledFeatures::{featureName}Enabled 341 RuntimeEnabledFeatures::{featureName}Enabled
338 """ 342 """
339 extended_attributes = definition_or_member.extended_attributes 343 extended_attributes = definition_or_member.extended_attributes
340 if 'RuntimeEnabled' not in extended_attributes: 344 if 'RuntimeEnabled' not in extended_attributes:
341 return None 345 return None
342 feature_name = extended_attributes['RuntimeEnabled'] 346 feature_name = extended_attributes['RuntimeEnabled']
343 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) 347 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698