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

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

Issue 360703003: Implement Blink-in-JS for DOM methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/templates/interface_base.cpp » ('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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 def scoped_name(interface, definition, base_name): 119 def scoped_name(interface, definition, base_name):
120 # partial interfaces are implemented as separate classes, with their members 120 # partial interfaces are implemented as separate classes, with their members
121 # implemented as static member functions 121 # implemented as static member functions
122 partial_interface_implemented_as = definition.extended_attributes.get('Parti alInterfaceImplementedAs') 122 partial_interface_implemented_as = definition.extended_attributes.get('Parti alInterfaceImplementedAs')
123 if partial_interface_implemented_as: 123 if partial_interface_implemented_as:
124 return '%s::%s' % (partial_interface_implemented_as, base_name) 124 return '%s::%s' % (partial_interface_implemented_as, base_name)
125 if (definition.is_static or 125 if (definition.is_static or
126 definition.name in ('Constructor', 'NamedConstructor')): 126 definition.name in ('Constructor', 'NamedConstructor')):
127 return '%s::%s' % (cpp_name(interface), base_name) 127 return '%s::%s' % (cpp_name(interface), base_name)
128 if 'ImplementedInPrivateScript' in definition.extended_attributes:
129 return base_name
128 return 'impl->%s' % base_name 130 return 'impl->%s' % base_name
129 131
130 132
131 def v8_class_name(interface): 133 def v8_class_name(interface):
132 return v8_types.v8_type(interface.name) 134 return v8_types.v8_type(interface.name)
133 135
134 136
135 ################################################################################ 137 ################################################################################
136 # Specific extended attributes 138 # Specific extended attributes
137 ################################################################################ 139 ################################################################################
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 267
266 The returned function checks if a method/attribute is enabled. 268 The returned function checks if a method/attribute is enabled.
267 Given extended attribute RuntimeEnabled=FeatureName, return: 269 Given extended attribute RuntimeEnabled=FeatureName, return:
268 RuntimeEnabledFeatures::{featureName}Enabled 270 RuntimeEnabledFeatures::{featureName}Enabled
269 """ 271 """
270 extended_attributes = definition_or_member.extended_attributes 272 extended_attributes = definition_or_member.extended_attributes
271 if 'RuntimeEnabled' not in extended_attributes: 273 if 'RuntimeEnabled' not in extended_attributes:
272 return None 274 return None
273 feature_name = extended_attributes['RuntimeEnabled'] 275 feature_name = extended_attributes['RuntimeEnabled']
274 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) 276 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698