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

Unified Diff: headless/lib/browser/devtools_api/client_api_generator.py

Issue 2666503002: Make headless_shell target compile for Windows (Closed)
Patch Set: Fix initlogging placing, always enable logging in Windows Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/app/headless_shell.cc ('k') | headless/lib/browser/devtools_api/domain_cc.template » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/devtools_api/client_api_generator.py
diff --git a/headless/lib/browser/devtools_api/client_api_generator.py b/headless/lib/browser/devtools_api/client_api_generator.py
index 435358af73da43c8c409fb8bbaee92c1f3ab51d3..fd011e10ffd65fffb653fb6c1c3aff3a1bed25dd 100644
--- a/headless/lib/browser/devtools_api/client_api_generator.py
+++ b/headless/lib/browser/devtools_api/client_api_generator.py
@@ -65,6 +65,11 @@ def SanitizeLiteral(literal):
return {
# Rename null enumeration values to avoid a clash with the NULL macro.
'null': 'none',
+ # Rename literals that clash with Win32 defined macros.
+ 'error': 'err',
+ 'mouseMoved': 'mouse_ptr_moved',
+ 'Strict': 'exact',
+ 'getCurrentTime': 'getCurrentAnimationTime',
# Rename mathematical constants to avoid colliding with C macros.
'Infinity': 'InfinityValue',
'-Infinity': 'NegativeInfinityValue',
@@ -321,10 +326,10 @@ def SynthesizeCommandTypes(json_api):
if 'enum' in parameter and not '$ref' in parameter:
SynthesizeEnumType(domain, command['name'], parameter)
parameters_type = {
- 'id': ToTitleCase(command['name']) + 'Params',
+ 'id': ToTitleCase(SanitizeLiteral(command['name'])) + 'Params',
'type': 'object',
'description': 'Parameters for the %s command.' % ToTitleCase(
- command['name']),
+ SanitizeLiteral(command['name'])),
'properties': command['parameters']
}
domain['types'].append(parameters_type)
@@ -333,10 +338,10 @@ def SynthesizeCommandTypes(json_api):
if 'enum' in parameter and not '$ref' in parameter:
SynthesizeEnumType(domain, command['name'], parameter)
result_type = {
- 'id': ToTitleCase(command['name']) + 'Result',
+ 'id': ToTitleCase(SanitizeLiteral(command['name'])) + 'Result',
'type': 'object',
'description': 'Result for the %s command.' % ToTitleCase(
- command['name']),
+ SanitizeLiteral(command['name'])),
'properties': command['returns']
}
domain['types'].append(result_type)
« no previous file with comments | « headless/app/headless_shell.cc ('k') | headless/lib/browser/devtools_api/domain_cc.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698