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

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

Issue 2029423002: Clean up V8 bindings template code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 # Attributes 275 # Attributes
276 attributes = [v8_attributes.attribute_context(interface, attribute) 276 attributes = [v8_attributes.attribute_context(interface, attribute)
277 for attribute in interface.attributes] 277 for attribute in interface.attributes]
278 278
279 has_conditional_attributes = any(attribute['exposed_test'] for attribute in attributes) 279 has_conditional_attributes = any(attribute['exposed_test'] for attribute in attributes)
280 if has_conditional_attributes and interface.is_partial: 280 if has_conditional_attributes and interface.is_partial:
281 raise Exception('Conditional attributes between partial interfaces in mo dules and the original interfaces(%s) in core are not allowed.' % interface.name ) 281 raise Exception('Conditional attributes between partial interfaces in mo dules and the original interfaces(%s) in core are not allowed.' % interface.name )
282 282
283 context.update({ 283 context.update({
284 'attributes': attributes, 284 'attributes': attributes,
285 'has_accessor_configuration': any(
286 not (attribute['exposed_test'] or
287 attribute['runtime_enabled_function']) and
288 not attribute['is_data_type_property'] and
289 attribute['should_be_exposed_to_script']
290 for attribute in attributes),
291 'has_attribute_configuration': any(
292 not (attribute['exposed_test'] or
293 attribute['runtime_enabled_function']) and
294 attribute['is_data_type_property'] and
295 attribute['should_be_exposed_to_script']
296 for attribute in attributes),
297 'has_constructor_attributes': any(
298 attribute['constructor_type']
299 for attribute in attributes),
300 'has_replaceable_attributes': any(
301 attribute['is_replaceable'] and
302 not attribute['is_data_type_property']
303 for attribute in attributes),
304 }) 285 })
305 286
306 # Methods 287 # Methods
307 methods = [] 288 methods = []
308 if interface.original_interface: 289 if interface.original_interface:
309 methods.extend([v8_methods.method_context(interface, operation, is_visib le=False) 290 methods.extend([v8_methods.method_context(interface, operation, is_visib le=False)
310 for operation in interface.original_interface.operations 291 for operation in interface.original_interface.operations
311 if operation.name]) 292 if operation.name])
312 methods.extend([v8_methods.method_context(interface, method) 293 methods.extend([v8_methods.method_context(interface, method)
313 for method in interface.operations 294 for method in interface.operations
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 1359
1379 extended_attributes = deleter.extended_attributes 1360 extended_attributes = deleter.extended_attributes
1380 idl_type = deleter.idl_type 1361 idl_type = deleter.idl_type
1381 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1362 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1382 return { 1363 return {
1383 'is_call_with_script_state': is_call_with_script_state, 1364 'is_call_with_script_state': is_call_with_script_state,
1384 'is_custom': 'Custom' in extended_attributes, 1365 'is_custom': 'Custom' in extended_attributes,
1385 'is_raises_exception': 'RaisesException' in extended_attributes, 1366 'is_raises_exception': 'RaisesException' in extended_attributes,
1386 'name': cpp_name(deleter), 1367 'name': cpp_name(deleter),
1387 } 1368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698