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

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

Issue 1873323002: Have bindings layer assume and insist that all interface types are GCed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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 # 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 dependency_interface.extended_attributes.update(target_interface.ext ended_attributes) 196 dependency_interface.extended_attributes.update(target_interface.ext ended_attributes)
197 assert target_interface == definitions.interfaces[dependency_interfa ce.name] 197 assert target_interface == definitions.interfaces[dependency_interfa ce.name]
198 # A partial interface should use its original interface's 198 # A partial interface should use its original interface's
199 # ImplementedAs. If the original interface doesn't have, 199 # ImplementedAs. If the original interface doesn't have,
200 # remove ImplementedAs defined in the partial interface. 200 # remove ImplementedAs defined in the partial interface.
201 # Because partial interface needs the original interface's 201 # Because partial interface needs the original interface's
202 # cpp class to obtain partial interface's cpp class. 202 # cpp class to obtain partial interface's cpp class.
203 # e.g.. V8WindowPartial.cpp: 203 # e.g.. V8WindowPartial.cpp:
204 # DOMWindow* impl = V8Window::toImpl(holder); 204 # DOMWindow* impl = V8Window::toImpl(holder);
205 # RawPtr<...> cppValue(DOMWindowQuota::webkitStorageInfo(impl)); 205 # DOMWindowQuota* cppValue(DOMWindowQuota::webkitStorageInfo(impl) );
206 # TODO(tasak): remove ImplementedAs extended attributes 206 # TODO(tasak): remove ImplementedAs extended attributes
207 # from all partial interfaces. Instead, rename all cpp/header 207 # from all partial interfaces. Instead, rename all cpp/header
208 # files correctly. ImplementedAs should not be allowed in 208 # files correctly. ImplementedAs should not be allowed in
209 # partial interfaces. 209 # partial interfaces.
210 if 'ImplementedAs' not in target_interface.extended_attributes: 210 if 'ImplementedAs' not in target_interface.extended_attributes:
211 dependency_interface.extended_attributes.pop('ImplementedAs', No ne) 211 dependency_interface.extended_attributes.pop('ImplementedAs', No ne)
212 dependency_interface.original_interface = target_interface 212 dependency_interface.original_interface = target_interface
213 target_interface.partial_interfaces.append(dependency_interface) 213 target_interface.partial_interfaces.append(dependency_interface)
214 resolved_definitions[dependency_component] = dependency_definitions 214 resolved_definitions[dependency_component] = dependency_definitions
215 else: 215 else:
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 # This loop may process the same interface many times, so it's 337 # This loop may process the same interface many times, so it's
338 # possible that we're adding the same attributes twice or more. 338 # possible that we're adding the same attributes twice or more.
339 # So check if there is a duplicate. 339 # So check if there is a duplicate.
340 for attr in inherited_unforgeable_attributes: 340 for attr in inherited_unforgeable_attributes:
341 if attr not in interface.attributes: 341 if attr not in interface.attributes:
342 interface.attributes.append(attr) 342 interface.attributes.append(attr)
343 referenced_interfaces.extend(interface_info.get('referenced_interfac es', [])) 343 referenced_interfaces.extend(interface_info.get('referenced_interfac es', []))
344 interface_info['referenced_interfaces'] = sorted(set(referenced_inte rfaces)) 344 interface_info['referenced_interfaces'] = sorted(set(referenced_inte rfaces))
345 merge_dict_recursively(interface_info, 345 merge_dict_recursively(interface_info,
346 {'cpp_includes': {component: cpp_includes}}) 346 {'cpp_includes': {component: cpp_includes}})
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698