OLD | NEW |
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 protocol_{{domain.domain}}_api_h | 7 #ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h |
8 #define protocol_{{domain.domain}}_api_h | 8 #define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h |
9 | 9 |
10 #include "{{config.class_export.header}}" | 10 #include "{{config.class_export.header}}" |
11 #include "{{config.lib_package}}/InspectorProtocol.h" | 11 #include "{{config.exported.string_header}}" |
12 | 12 |
13 namespace blink { | 13 {% for namespace in config.protocol.namespace %} |
14 namespace protocol { | 14 namespace {{namespace}} { |
| 15 {% endfor %} |
15 namespace {{domain.domain}} { | 16 namespace {{domain.domain}} { |
16 namespace API { | 17 namespace API { |
17 | 18 |
18 // ------------- Enums. | 19 // ------------- Enums. |
19 {% for type in domain.types %} | 20 {% for type in domain.types %} |
20 {% if ("enum" in type) and type.exported %} | 21 {% if ("enum" in type) and type.exported %} |
21 | 22 |
22 namespace {{type.id}}Enum { | 23 namespace {{type.id}}Enum { |
23 {% for literal in type.enum %} | 24 {% for literal in type.enum %} |
24 {{config.class_export.macro}} extern const char* {{ literal | dash_to_camelcase}
}; | 25 {{config.class_export.macro}} extern const char* {{ literal | dash_to_camelcase}
}; |
(...skipping 15 matching lines...) Expand all Loading... |
40 {% endif %} | 41 {% endif %} |
41 {% endfor %} | 42 {% endfor %} |
42 {% endfor %} | 43 {% endfor %} |
43 | 44 |
44 // ------------- Types. | 45 // ------------- Types. |
45 {% for type in domain.types %} | 46 {% for type in domain.types %} |
46 {% if not (type.type == "object") or not ("properties" in type) or not (type
.exported) %}{% continue %}{% endif %} | 47 {% if not (type.type == "object") or not ("properties" in type) or not (type
.exported) %}{% continue %}{% endif %} |
47 | 48 |
48 class {{config.class_export.macro}} {{type.id}} { | 49 class {{config.class_export.macro}} {{type.id}} { |
49 public: | 50 public: |
50 virtual String16 toJSONString() const = 0; | 51 virtual {{config.exported.string_out}} toJSONString() const = 0; |
51 virtual ~{{type.id}}() { } | 52 virtual ~{{type.id}}() { } |
52 static std::unique_ptr<protocol::{{domain.domain}}::API::{{type.id}}> fromJS
ONString(const String16& json); | 53 static std::unique_ptr<protocol::{{domain.domain}}::API::{{type.id}}> fromJS
ONString(const {{config.exported.string_in}}& json); |
53 }; | 54 }; |
54 {% endfor %} | 55 {% endfor %} |
55 | 56 |
56 } // namespace API | 57 } // namespace API |
57 } // namespace {{domain.domain}} | 58 } // namespace {{domain.domain}} |
58 } // namespace protocol | 59 {% for namespace in config.protocol.namespace %} |
59 } // namespace blink | 60 } // namespace {{namespace}} |
| 61 {% endfor %} |
60 | 62 |
61 #endif // !defined(protocol_{{domain.domain}}_api_h) | 63 #endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api
_h) |
OLD | NEW |