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