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

Unified Diff: Source/bindings/scripts/utilities.py

Issue 1257613003: bindings: Supports inheritance of [Unforgeable] attributes as accessor-type properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made inherit_unforgeable_attributes more robust. Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/scripts/utilities.py
diff --git a/Source/bindings/scripts/utilities.py b/Source/bindings/scripts/utilities.py
index 8bd855514bd36c421b98c5523aed82a2f37cee1b..7c89a62c40a9aca51392148b2c07f397b7fadd8f 100644
--- a/Source/bindings/scripts/utilities.py
+++ b/Source/bindings/scripts/utilities.py
@@ -182,6 +182,26 @@ def load_interfaces_info_overall_pickle(info_dir):
return pickle.load(interface_info_file)
+def merge_dict_recursively(target, diff):
+ """Merges two dicts into one.
+ |target| will be updated with |diff|. Part of |diff| may be re-used in
+ |target|.
+ """
+ for key, value in diff.iteritems():
+ if key not in target:
+ target[key] = value
+ elif type(value) == dict:
+ merge_dict_recursively(target[key], value)
+ elif type(value) == list:
+ target[key].extend(value)
+ elif type(value) == set:
+ target[key].update(value)
+ else:
+ # Testing IDLs want to overwrite the values. Production code
+ # doesn't need any overwriting.
+ target[key] = value
+
+
def create_component_info_provider_core(info_dir):
interfaces_info = load_interfaces_info_overall_pickle(info_dir)
with open(os.path.join(info_dir, 'core', 'ComponentInfoCore.pickle')) as component_info_file:

Powered by Google App Engine
This is Rietveld 408576698