OLD | NEW |
(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 protocol_{{domain.domain}}_api_h |
| 8 #define protocol_{{domain.domain}}_api_h |
| 9 |
| 10 {% if export_macro == "PLATFORM_EXPORT" %} |
| 11 #include "platform/inspector_protocol/Platform.h" |
| 12 {% else %} |
| 13 #include "core/CoreExport.h" |
| 14 {% endif %} |
| 15 #include "platform/inspector_protocol/String16.h" |
| 16 |
| 17 namespace blink { |
| 18 namespace protocol { |
| 19 namespace {{domain.domain}} { |
| 20 namespace API { |
| 21 |
| 22 // ------------- Enums. |
| 23 {% for type in domain.types %} |
| 24 {% if ("enum" in type) and type.exported %} |
| 25 |
| 26 namespace {{type.id}}Enum { |
| 27 {% for literal in type.enum %} |
| 28 {{export_macro}} extern const char* {{ literal | dash_to_camelcase}}; |
| 29 {% endfor %} |
| 30 } // {{type.id}}Enum |
| 31 {% endif %} |
| 32 {% endfor %} |
| 33 {% for command in join_arrays(domain, ["commands", "events"]) %} |
| 34 {% for param in join_arrays(command, ["parameters", "returns"]) %} |
| 35 {% if ("enum" in param) and (param.exported) %} |
| 36 |
| 37 namespace {{command.name | to_title_case}} { |
| 38 namespace {{param.name | to_title_case}}Enum { |
| 39 {% for literal in param.enum %} |
| 40 {{export_macro}} extern const char* {{ literal | dash_to_camelcase}}; |
| 41 {% endfor %} |
| 42 } // {{param.name | to_title_case}}Enum |
| 43 } // {{command.name | to_title_case }} |
| 44 {% endif %} |
| 45 {% endfor %} |
| 46 {% endfor %} |
| 47 |
| 48 // ------------- Types. |
| 49 {% for type in domain.types %} |
| 50 {% if not (type.type == "object") or not ("properties" in type) or not (type
.exported) %}{% continue %}{% endif %} |
| 51 |
| 52 class {{export_macro}} {{type.id}} { |
| 53 public: |
| 54 virtual String16 toJSONString() const = 0; |
| 55 virtual ~{{type.id}}() { } |
| 56 static std::unique_ptr<protocol::{{domain.domain}}::API::{{type.id}}> fromJS
ONString(const String16& json); |
| 57 }; |
| 58 {% endfor %} |
| 59 |
| 60 } // namespace API |
| 61 } // namespace {{domain.domain}} |
| 62 } // namespace protocol |
| 63 } // namespace blink |
| 64 |
| 65 #endif // !defined(protocol_{{domain.domain}}_api_h) |
OLD | NEW |