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

Unified Diff: Source/build/scripts/name_macros.py

Issue 137313004: Fix conditional TouchEvent creation support (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add build-time validation Created 6 years, 11 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
« no previous file with comments | « no previous file | Source/core/events/EventAliases.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/name_macros.py
diff --git a/Source/build/scripts/name_macros.py b/Source/build/scripts/name_macros.py
index a1655bd4f2c66775bbb6b643b22b891e2ae9780e..9aa4e570ff817e0e8e946707d65adcf392c163e2 100644
--- a/Source/build/scripts/name_macros.py
+++ b/Source/build/scripts/name_macros.py
@@ -69,11 +69,30 @@ class Writer(in_generator.Writer):
self.namespace = self.in_file.parameters['namespace'].strip('"')
self._entries_by_conditional = {}
self._unconditional_entries = []
+ self._validate_entries()
self._sort_entries_by_conditional()
self._outputs = {(self.namespace + "Headers.h"): self.generate_headers_header,
(self.namespace + "Interfaces.h"): self.generate_interfaces_header,
}
+ def _validate_entries(self):
+ # If there is more than one entry with the same script name, only the first one will ever
+ # be hit in practice, and so we'll silently ignore any properties requested for the second
+ # (like RuntimeEnabled - see crbug.com/332588).
+ entries_by_script_name = dict()
+ for entry in self.in_file.name_dictionaries:
+ script_name = name_utilities.script_name(entry)
+ if script_name in entries_by_script_name:
+ self._fatal('Multiple entries with script_name=%(script_name)s: %(name1)s %(name2)s' % {
+ 'script_name': script_name,
+ 'name1': entry['name'],
+ 'name2': entries_by_script_name[script_name]['name']})
+ entries_by_script_name[script_name] = entry
+
+ def _fatal(self, message):
+ print 'FATAL ERROR: ' + message
+ exit(1)
+
def _sort_entries_by_conditional(self):
unconditional_names = set()
for entry in self.in_file.name_dictionaries:
« no previous file with comments | « no previous file | Source/core/events/EventAliases.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698