| 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 {{class_name}}_h |
| 8 #define {{class_name}}_h |
| 9 |
| 10 |
| 11 #include "platform/inspector_protocol/FrontendChannel.h" |
| 12 #include "platform/inspector_protocol/TypeBuilder.h" |
| 13 |
| 14 namespace blink { |
| 15 namespace protocol { |
| 16 |
| 17 using ErrorString = String; |
| 18 |
| 19 class PLATFORM_EXPORT Frontend { |
| 20 public: |
| 21 Frontend(FrontendChannel*); |
| 22 FrontendChannel* channel() { return m_frontendChannel; } |
| 23 |
| 24 {% for domain in api.domains %} |
| 25 |
| 26 class PLATFORM_EXPORT {{domain.domain}} { |
| 27 public: |
| 28 static {{domain.domain}}* from(Frontend* frontend) { return &(frontend->
m_{{domain.domain | lower}}) ;} |
| 29 {{domain.domain}}(FrontendChannel* frontendChannel) : m_frontendChannel(
frontendChannel) { } |
| 30 {% for event in domain.events %} |
| 31 {% if "handlers" in event and not ("renderer" in event["handlers"]) %}{% con
tinue %}{% endif %} |
| 32 void {{event.name}}( |
| 33 {%- for parameter in event.parameters -%} |
| 34 {%- if "optional" in parameter -%} |
| 35 {{resolve_type(parameter).optional_pass_type}} |
| 36 {%- else -%} |
| 37 {{resolve_type(parameter).pass_type}} |
| 38 {%- endif %} {{parameter.name}}{%- if not loop.last -%}, {% endif -%} |
| 39 {%- endfor -%} |
| 40 ); |
| 41 {% endfor %} |
| 42 |
| 43 void flush() { m_frontendChannel->flush(); } |
| 44 private: |
| 45 FrontendChannel* m_frontendChannel; |
| 46 }; |
| 47 {% endfor %} |
| 48 |
| 49 private: |
| 50 FrontendChannel* m_frontendChannel; |
| 51 {% for domain in api.domains %} |
| 52 {{domain.domain}} m_{{domain.domain | lower}}; |
| 53 {% endfor %} |
| 54 }; |
| 55 |
| 56 } // namespace protocol |
| 57 } // namespace blink |
| 58 |
| 59 #endif // !defined({{class_name}}_h) |
| OLD | NEW |