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

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

Issue 795833004: Use dictionaries for context creation attributes. Eliminate custom bindings. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years 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/core/v8/v8.gypi ('k') | Source/bindings/scripts/v8_methods.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 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generate template contexts of dictionaries for both v8 bindings and 5 """Generate template contexts of dictionaries for both v8 bindings and
6 implementation classes that are used by blink's core/modules. 6 implementation classes that are used by blink's core/modules.
7 """ 7 """
8 8
9 import operator 9 import operator
10 from idl_types import IdlType 10 from idl_types import IdlType
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 def dictionary_context(dictionary, interfaces_info): 52 def dictionary_context(dictionary, interfaces_info):
53 includes.clear() 53 includes.clear()
54 includes.update(DICTIONARY_CPP_INCLUDES) 54 includes.update(DICTIONARY_CPP_INCLUDES)
55 cpp_class = v8_utilities.cpp_name(dictionary) 55 cpp_class = v8_utilities.cpp_name(dictionary)
56 context = { 56 context = {
57 'cpp_class': cpp_class, 57 'cpp_class': cpp_class,
58 'header_includes': set(DICTIONARY_H_INCLUDES), 58 'header_includes': set(DICTIONARY_H_INCLUDES),
59 'members': [member_context(member) 59 'members': [member_context(member)
60 for member in sorted(dictionary.members, 60 for member in sorted(dictionary.members,
61 key=operator.attrgetter('name'))], 61 key=operator.attrgetter('name'))],
62 'use_permissive_dictionary_conversion': 'PermissiveDictionaryConversion' in dictionary.extended_attributes,
62 'v8_class': v8_types.v8_type(cpp_class), 63 'v8_class': v8_types.v8_type(cpp_class),
63 'v8_original_class': v8_types.v8_type(dictionary.name), 64 'v8_original_class': v8_types.v8_type(dictionary.name),
64 } 65 }
65 if dictionary.parent: 66 if dictionary.parent:
66 IdlType(dictionary.parent).add_includes_for_type() 67 IdlType(dictionary.parent).add_includes_for_type()
67 parent_cpp_class = v8_utilities.cpp_name_from_interfaces_info( 68 parent_cpp_class = v8_utilities.cpp_name_from_interfaces_info(
68 dictionary.parent, interfaces_info) 69 dictionary.parent, interfaces_info)
69 context.update({ 70 context.update({
70 'parent_cpp_class': parent_cpp_class, 71 'parent_cpp_class': parent_cpp_class,
71 'parent_v8_class': v8_types.v8_type(parent_cpp_class), 72 'parent_v8_class': v8_types.v8_type(parent_cpp_class),
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 'getter_expression': getter_expression(), 175 'getter_expression': getter_expression(),
175 'has_method_expression': has_method_expression(), 176 'has_method_expression': has_method_expression(),
176 'has_method_name': has_method_name_for_dictionary_member(member), 177 'has_method_name': has_method_name_for_dictionary_member(member),
177 'is_object': is_object, 178 'is_object': is_object,
178 'is_traceable': idl_type.is_traceable, 179 'is_traceable': idl_type.is_traceable,
179 'member_cpp_type': member_cpp_type(), 180 'member_cpp_type': member_cpp_type(),
180 'null_setter_name': null_setter_name_for_dictionary_member(member), 181 'null_setter_name': null_setter_name_for_dictionary_member(member),
181 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), 182 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
182 'setter_name': setter_name_for_dictionary_member(member), 183 'setter_name': setter_name_for_dictionary_member(member),
183 } 184 }
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/v8.gypi ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698