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

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

Issue 2742213002: bindings: Make v8_union iterate through its members by type name (Closed)
Patch Set: Created 3 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 | « no previous file | third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h » ('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 import v8_types 5 import v8_types
6 import v8_utilities 6 import v8_utilities
7 7
8 8
9 UNION_CPP_INCLUDES = frozenset([ 9 UNION_CPP_INCLUDES = frozenset([
10 'bindings/core/v8/ToV8.h', 10 'bindings/core/v8/ToV8.h',
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 array_buffer_type = None 47 array_buffer_type = None
48 array_buffer_view_type = None 48 array_buffer_view_type = None
49 array_or_sequence_type = None 49 array_or_sequence_type = None
50 boolean_type = None 50 boolean_type = None
51 dictionary_type = None 51 dictionary_type = None
52 interface_types = [] 52 interface_types = []
53 numeric_type = None 53 numeric_type = None
54 object_type = None 54 object_type = None
55 record_type = None 55 record_type = None
56 string_type = None 56 string_type = None
57 for member in union_type.member_types: 57 for member in sorted(union_type.member_types, key=lambda m: m.name):
58 context = member_context(member, interfaces_info) 58 context = member_context(member, interfaces_info)
59 members.append(context) 59 members.append(context)
60 if member.base_type == 'ArrayBuffer': 60 if member.base_type == 'ArrayBuffer':
61 if array_buffer_type: 61 if array_buffer_type:
62 raise Exception('%s is ambiguous.' % union_type.name) 62 raise Exception('%s is ambiguous.' % union_type.name)
63 array_buffer_type = context 63 array_buffer_type = context
64 elif member.base_type == 'ArrayBufferView': 64 elif member.base_type == 'ArrayBufferView':
65 if array_buffer_view_type: 65 if array_buffer_view_type:
66 raise Exception('%s is ambiguous.' % union_type.name) 66 raise Exception('%s is ambiguous.' % union_type.name)
67 array_buffer_view_type = context 67 array_buffer_view_type = context
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 'enum_values': member.enum_values, 157 'enum_values': member.enum_values,
158 'is_array_buffer_or_view_type': member.is_array_buffer_or_view, 158 'is_array_buffer_or_view_type': member.is_array_buffer_or_view,
159 'is_traceable': member.is_traceable, 159 'is_traceable': member.is_traceable,
160 'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True), 160 'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True),
161 'specific_type_enum': 'SpecificType' + member.name, 161 'specific_type_enum': 'SpecificType' + member.name,
162 'type_name': member.name, 162 'type_name': member.name,
163 'v8_value_to_local_cpp_value': member.v8_value_to_local_cpp_value( 163 'v8_value_to_local_cpp_value': member.v8_value_to_local_cpp_value(
164 {}, 'v8Value', 'cppValue', isolate='isolate', 164 {}, 'v8Value', 'cppValue', isolate='isolate',
165 use_exception_state=True) 165 use_exception_state=True)
166 } 166 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698