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

Side by Side Diff: Source/bindings/scripts/unstable/code_generator_v8.py

Issue 151173004: IDL compiler: [GarbageCollected] on other interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload Created 6 years, 10 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
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 v8_types.set_enums((enum.name, enum.values) 97 v8_types.set_enums((enum.name, enum.values)
98 for enum in definitions.enumerations.values()) 98 for enum in definitions.enumerations.values())
99 v8_types.set_ancestors(dict( 99 v8_types.set_ancestors(dict(
100 (interface_name, interface_info['ancestors']) 100 (interface_name, interface_info['ancestors'])
101 for interface_name, interface_info in interfaces_info.iteritems() 101 for interface_name, interface_info in interfaces_info.iteritems()
102 if 'ancestors' in interface_info)) 102 if 'ancestors' in interface_info))
103 v8_types.set_callback_interfaces(set( 103 v8_types.set_callback_interfaces(set(
104 interface_name 104 interface_name
105 for interface_name, interface_info in interfaces_info.iteritems() 105 for interface_name, interface_info in interfaces_info.iteritems()
106 if interface_info['is_callback_interface'])) 106 if interface_info['is_callback_interface']))
107 v8_types.set_garbage_collected_types(set(
108 interface_name
109 for interface_name, interface_info in interfaces_info.iteritems()
110 if 'inherited_extended_attributes' in interface_info and
111 'GarbageCollected' in interface_info['inherited_extended_attributes' ]))
107 v8_types.set_implemented_as_interfaces(dict( 112 v8_types.set_implemented_as_interfaces(dict(
108 (interface_name, interface_info['implemented_as']) 113 (interface_name, interface_info['implemented_as'])
109 for interface_name, interface_info in interfaces_info.iteritems() 114 for interface_name, interface_info in interfaces_info.iteritems()
110 if 'implemented_as' in interface_info)) 115 if 'implemented_as' in interface_info))
111 116
112 # Generate contents (input parameters for Jinja) 117 # Generate contents (input parameters for Jinja)
113 template_contents = generate_contents(interface) 118 template_contents = generate_contents(interface)
114 template_contents['header_includes'].add(interface_info['include_path']) 119 template_contents['header_includes'].add(interface_info['include_path'])
115 template_contents['header_includes'] = sorted(template_contents['header_incl udes']) 120 template_contents['header_includes'] = sorted(template_contents['header_incl udes'])
116 includes.update(interface_info.get('dependencies_include_paths', [])) 121 includes.update(interface_info.get('dependencies_include_paths', []))
(...skipping 25 matching lines...) Expand all
142 147
143 148
144 # [RuntimeEnabled] 149 # [RuntimeEnabled]
145 def runtime_enabled_if(code, runtime_enabled_function_name): 150 def runtime_enabled_if(code, runtime_enabled_function_name):
146 if not runtime_enabled_function_name: 151 if not runtime_enabled_function_name:
147 return code 152 return code
148 # Indent if statement to level of original code 153 # Indent if statement to level of original code
149 indent = re.match(' *', code).group(0) 154 indent = re.match(' *', code).group(0)
150 return ('%sif (%s())\n' % (indent, runtime_enabled_function_name) + 155 return ('%sif (%s())\n' % (indent, runtime_enabled_function_name) +
151 ' %s' % code) 156 ' %s' % code)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698