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

Side by Side Diff: third_party/inspector_protocol/templates/Exported_h.template

Issue 2553513002: [inspector] Roll inspector_protocol to c65b17da8a32bc6ab25b4ebbef1008f23c69e7d1. (Closed)
Patch Set: Created 4 years 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 // 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 {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h 7 #ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h
8 #define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h 8 #define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h
9 9
10 {% if config.exported.export_header %} 10 {% if config.exported.export_header %}
11 #include {{format_include(config.exported.export_header)}} 11 #include {{format_include(config.exported.export_header)}}
12 {% endif %} 12 {% endif %}
13 #include {{format_include(config.exported.string_header)}} 13 #include {{format_include(config.exported.string_header)}}
14 14
15 {% for namespace in config.protocol.namespace %} 15 {% for namespace in config.protocol.namespace %}
16 namespace {{namespace}} { 16 namespace {{namespace}} {
17 {% endfor %} 17 {% endfor %}
18 namespace {{domain.domain}} { 18 namespace {{domain.domain}} {
19 namespace API { 19 namespace API {
20 20
21 // ------------- Enums. 21 // ------------- Enums.
22 {% for type in domain.types %} 22 {% for type in domain.types %}
23 {% if ("enum" in type) and type.exported %} 23 {% if ("enum" in type) and protocol.is_exported(domain.domain, type.id) %}
24 24
25 namespace {{type.id}}Enum { 25 namespace {{type.id}}Enum {
26 {% for literal in type.enum %} 26 {% for literal in type.enum %}
27 {{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelca se}}; 27 {{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelca se}};
28 {% endfor %} 28 {% endfor %}
29 } // {{type.id}}Enum 29 } // {{type.id}}Enum
30 {% endif %} 30 {% endif %}
31 {% endfor %} 31 {% endfor %}
32 {% for command in join_arrays(domain, ["commands", "events"]) %} 32 {% for command in join_arrays(domain, ["commands", "events"]) %}
33 {% for param in join_arrays(command, ["parameters", "returns"]) %} 33 {% for param in join_arrays(command, ["parameters", "returns"]) %}
34 {% if ("enum" in param) and (param.exported) %} 34 {% if ("enum" in param) and protocol.is_exported(domain.domain, command.na me + "." + param.name) %}
35 35
36 namespace {{command.name | to_title_case}} { 36 namespace {{command.name | to_title_case}} {
37 namespace {{param.name | to_title_case}}Enum { 37 namespace {{param.name | to_title_case}}Enum {
38 {% for literal in param.enum %} 38 {% for literal in param.enum %}
39 {{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelca se}}; 39 {{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelca se}};
40 {% endfor %} 40 {% endfor %}
41 } // {{param.name | to_title_case}}Enum 41 } // {{param.name | to_title_case}}Enum
42 } // {{command.name | to_title_case }} 42 } // {{command.name | to_title_case }}
43 {% endif %} 43 {% endif %}
44 {% endfor %} 44 {% endfor %}
45 {% endfor %} 45 {% endfor %}
46 46
47 // ------------- Types. 47 // ------------- Types.
48 {% for type in domain.types %} 48 {% for type in domain.types %}
49 {% if not (type.type == "object") or not ("properties" in type) or not (type .exported) %}{% continue %}{% endif %} 49 {% if not (type.type == "object") or not ("properties" in type) or not proto col.is_exported(domain.domain, type.id) %}{% continue %}{% endif %}
50 50
51 class {{config.exported.export_macro}} {{type.id}} { 51 class {{config.exported.export_macro}} {{type.id}} {
52 public: 52 public:
53 virtual {{config.exported.string_out}} toJSONString() const = 0; 53 virtual {{config.exported.string_out}} toJSONString() const = 0;
54 virtual ~{{type.id}}() { } 54 virtual ~{{type.id}}() { }
55 static std::unique_ptr<protocol::{{domain.domain}}::API::{{type.id}}> fromJS ONString(const {{config.exported.string_in}}& json); 55 static std::unique_ptr<protocol::{{domain.domain}}::API::{{type.id}}> fromJS ONString(const {{config.exported.string_in}}& json);
56 }; 56 };
57 {% endfor %} 57 {% endfor %}
58 58
59 } // namespace API 59 } // namespace API
60 } // namespace {{domain.domain}} 60 } // namespace {{domain.domain}}
61 {% for namespace in config.protocol.namespace %} 61 {% for namespace in config.protocol.namespace %}
62 } // namespace {{namespace}} 62 } // namespace {{namespace}}
63 {% endfor %} 63 {% endfor %}
64 64
65 #endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api _h) 65 #endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api _h)
OLDNEW
« no previous file with comments | « third_party/inspector_protocol/CodeGenerator.py ('k') | third_party/inspector_protocol/templates/Imported_h.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698