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

Side by Side Diff: third_party/WebKit/Source/platform/inspector_protocol/templates/Exported_h.template

Issue 2452853002: [inspector] use own version of third_party/inspector_protocol (Closed)
Patch Set: supported new inspector_protocol location in components/ui_devtools/BUILD.gn Created 4 years, 1 month 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
(Empty)
1 // This file is generated
2
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
5 // found in the LICENSE file.
6
7 #ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h
8 #define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h
9
10 {% if config.exported.export_header %}
11 #include {{format_include(config.exported.export_header)}}
12 {% endif %}
13 #include {{format_include(config.exported.string_header)}}
14
15 {% for namespace in config.protocol.namespace %}
16 namespace {{namespace}} {
17 {% endfor %}
18 namespace {{domain.domain}} {
19 namespace API {
20
21 // ------------- Enums.
22 {% for type in domain.types %}
23 {% if ("enum" in type) and type.exported %}
24
25 namespace {{type.id}}Enum {
26 {% for literal in type.enum %}
27 {{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelca se}};
28 {% endfor %}
29 } // {{type.id}}Enum
30 {% endif %}
31 {% endfor %}
32 {% for command in join_arrays(domain, ["commands", "events"]) %}
33 {% for param in join_arrays(command, ["parameters", "returns"]) %}
34 {% if ("enum" in param) and (param.exported) %}
35
36 namespace {{command.name | to_title_case}} {
37 namespace {{param.name | to_title_case}}Enum {
38 {% for literal in param.enum %}
39 {{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelca se}};
40 {% endfor %}
41 } // {{param.name | to_title_case}}Enum
42 } // {{command.name | to_title_case }}
43 {% endif %}
44 {% endfor %}
45 {% endfor %}
46
47 // ------------- Types.
48 {% for type in domain.types %}
49 {% if not (type.type == "object") or not ("properties" in type) or not (type .exported) %}{% continue %}{% endif %}
50
51 class {{config.exported.export_macro}} {{type.id}} {
52 public:
53 virtual {{config.exported.string_out}} toJSONString() const = 0;
54 virtual ~{{type.id}}() { }
55 static std::unique_ptr<protocol::{{domain.domain}}::API::{{type.id}}> fromJS ONString(const {{config.exported.string_in}}& json);
56 };
57 {% endfor %}
58
59 } // namespace API
60 } // namespace {{domain.domain}}
61 {% for namespace in config.protocol.namespace %}
62 } // namespace {{namespace}}
63 {% endfor %}
64
65 #endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api _h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698