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

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

Issue 2848243004: Clean up bindings/core/v8 (Part 2) (Closed)
Patch Set: Rebase Created 3 years, 7 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 import v8_methods 45 import v8_methods
46 import v8_types 46 import v8_types
47 import v8_utilities 47 import v8_utilities
48 from v8_utilities import (cpp_name_or_partial, cpp_name, has_extended_attribute_ value, 48 from v8_utilities import (cpp_name_or_partial, cpp_name, has_extended_attribute_ value,
49 runtime_enabled_feature_name, is_legacy_interface_type _checking) 49 runtime_enabled_feature_name, is_legacy_interface_type _checking)
50 50
51 51
52 INTERFACE_H_INCLUDES = frozenset([ 52 INTERFACE_H_INCLUDES = frozenset([
53 'bindings/core/v8/GeneratedCodeHelper.h', 53 'bindings/core/v8/GeneratedCodeHelper.h',
54 'bindings/core/v8/NativeValueTraits.h', 54 'bindings/core/v8/NativeValueTraits.h',
55 'bindings/core/v8/ScriptWrappable.h', 55 'platform/bindings/ScriptWrappable.h',
56 'bindings/core/v8/ToV8ForCore.h', 56 'bindings/core/v8/ToV8ForCore.h',
57 'bindings/core/v8/V8BindingForCore.h', 57 'bindings/core/v8/V8BindingForCore.h',
58 'bindings/core/v8/V8DOMWrapper.h', 58 'bindings/core/v8/V8DOMWrapper.h',
59 'bindings/core/v8/WrapperTypeInfo.h', 59 'bindings/core/v8/WrapperTypeInfo.h',
60 'platform/heap/Handle.h', 60 'platform/heap/Handle.h',
61 ]) 61 ])
62 INTERFACE_CPP_INCLUDES = frozenset([ 62 INTERFACE_CPP_INCLUDES = frozenset([
63 'bindings/core/v8/ExceptionState.h', 63 'bindings/core/v8/ExceptionState.h',
64 'bindings/core/v8/V8DOMConfiguration.h', 64 'bindings/core/v8/V8DOMConfiguration.h',
65 'bindings/core/v8/V8ObjectConstructor.h', 65 'bindings/core/v8/V8ObjectConstructor.h',
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 features = [{'name': name, 131 features = [{'name': name,
132 'constants': member_filter_by_name(origin_trial_constants, name ), 132 'constants': member_filter_by_name(origin_trial_constants, name ),
133 'attributes': member_filter_by_name(origin_trial_attributes, na me), 133 'attributes': member_filter_by_name(origin_trial_attributes, na me),
134 'methods': member_filter_by_name(origin_trial_methods, name)} 134 'methods': member_filter_by_name(origin_trial_methods, name)}
135 for name in feature_names] 135 for name in feature_names]
136 for feature in features: 136 for feature in features:
137 members = feature['constants'] + feature['attributes'] + feature['method s'] 137 members = feature['constants'] + feature['attributes'] + feature['method s']
138 feature['needs_instance'] = reduce(or_, (member.get('on_instance', False ) for member in members)) 138 feature['needs_instance'] = reduce(or_, (member.get('on_instance', False ) for member in members))
139 139
140 if features: 140 if features:
141 includes.add('bindings/core/v8/ScriptState.h') 141 includes.add('platform/bindings/ScriptState.h')
142 includes.add('core/origin_trials/OriginTrials.h') 142 includes.add('core/origin_trials/OriginTrials.h')
143 return sorted(features) 143 return sorted(features)
144 144
145 145
146 def interface_context(interface, interfaces): 146 def interface_context(interface, interfaces):
147 """Creates a Jinja template context for an interface. 147 """Creates a Jinja template context for an interface.
148 148
149 Args: 149 Args:
150 interface: An interface to create the context for 150 interface: An interface to create the context for
151 interfaces: A dict which maps an interface name to the definition 151 interfaces: A dict which maps an interface name to the definition
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 extended_attributes = deleter.extended_attributes 1409 extended_attributes = deleter.extended_attributes
1410 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1410 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1411 is_ce_reactions = 'CEReactions' in extended_attributes 1411 is_ce_reactions = 'CEReactions' in extended_attributes
1412 return { 1412 return {
1413 'is_call_with_script_state': is_call_with_script_state, 1413 'is_call_with_script_state': is_call_with_script_state,
1414 'is_ce_reactions': is_ce_reactions, 1414 'is_ce_reactions': is_ce_reactions,
1415 'is_custom': 'Custom' in extended_attributes, 1415 'is_custom': 'Custom' in extended_attributes,
1416 'is_raises_exception': 'RaisesException' in extended_attributes, 1416 'is_raises_exception': 'RaisesException' in extended_attributes,
1417 'name': cpp_name(deleter), 1417 'name': cpp_name(deleter),
1418 } 1418 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698