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

Side by Side Diff: headless/lib/browser/types_h.template

Issue 2219843002: headless: Make API generator more robust against weird enum literals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « headless/lib/browser/type_conversions_h.template ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This file is generated 1 // This file is generated
2 2
3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be 4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file. 5 // found in the LICENSE file.
6 6
7 #ifndef HEADLESS_PUBLIC_DOMAINS_TYPES_H_ 7 #ifndef HEADLESS_PUBLIC_DOMAINS_TYPES_H_
8 #define HEADLESS_PUBLIC_DOMAINS_TYPES_H_ 8 #define HEADLESS_PUBLIC_DOMAINS_TYPES_H_
9 9
10 #include "base/optional.h" 10 #include "base/optional.h"
(...skipping 21 matching lines...) Expand all
32 {% endfor %} 32 {% endfor %}
33 } // namespace {{domain.domain}} 33 } // namespace {{domain.domain}}
34 {% endfor %} 34 {% endfor %}
35 35
36 {% for domain in api.domains %} 36 {% for domain in api.domains %}
37 namespace {{domain.domain | camelcase_to_hacker_style}} { 37 namespace {{domain.domain | camelcase_to_hacker_style}} {
38 {% for type in domain.types %} 38 {% for type in domain.types %}
39 {% if "enum" in type %} 39 {% if "enum" in type %}
40 enum class {{type.id}} { 40 enum class {{type.id}} {
41 {% for literal in type.enum %} 41 {% for literal in type.enum %}
42 {{ literal | dash_to_camelcase | camelcase_to_hacker_style | upper | mangle_en um}}{{',' if not loop.last}} 42 {{ literal | sanitize_literal | dash_to_camelcase | camelcase_to_hacker_style | upper }}{{',' if not loop.last}}
43 {% endfor %} 43 {% endfor %}
44 }; 44 };
45 45
46 {% endif %} 46 {% endif %}
47 {% endfor %} 47 {% endfor %}
48 } // namespace {{domain.domain | camelcase_to_hacker_style}} 48 } // namespace {{domain.domain | camelcase_to_hacker_style}}
49 49
50 {% endfor %} 50 {% endfor %}
51 51
52 // ------------- Type and builder declarations. 52 // ------------- Type and builder declarations.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 }; 149 };
150 150
151 {% endfor %} 151 {% endfor %}
152 152
153 } // namespace {{domain.domain | camelcase_to_hacker_style}} 153 } // namespace {{domain.domain | camelcase_to_hacker_style}}
154 {% endfor %} 154 {% endfor %}
155 155
156 } // namespace headless 156 } // namespace headless
157 157
158 #endif // HEADLESS_PUBLIC_DOMAINS_TYPES_H_ 158 #endif // HEADLESS_PUBLIC_DOMAINS_TYPES_H_
OLDNEW
« no previous file with comments | « headless/lib/browser/type_conversions_h.template ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698