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

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

Issue 2012753003: DevTools: consolidate protocol generators for front-end, backend and type builder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 {{class_name}}_h
8 #define {{class_name}}_h
9
10 #include "platform/inspector_protocol/BackendCallback.h"
11 #include "platform/inspector_protocol/ErrorSupport.h"
12 #include "platform/inspector_protocol/TypeBuilder.h"
13
14 namespace blink {
15 namespace protocol {
16
17 {% for domain in api.domains %}
18
19 namespace {{domain.domain}} {
20
21 class PLATFORM_EXPORT Backend {
22 public:
23 {% for command in domain.commands %}
24 {% if "redirect" in command %}{% continue %}{% endif %}
25 {% if ("handlers" in command) and not ("renderer" in command["handlers"]) %} {% continue %}{% endif %}
26 {% if "async" in command %}
27 class PLATFORM_EXPORT {{command.name | to_title_case}}Callback : public Back endCallback {
28 public:
29 virtual void sendSuccess(
30 {%- for parameter in command.returns -%}
31 {%- if "optional" in parameter -%}
32 const Maybe<{{resolve_type(parameter).raw_type}}>& {{parameter.name} }
33 {%- else -%}
34 {{resolve_type(parameter).pass_type}} {{parameter.name}}
35 {%- endif -%}
36 {%- if not loop.last -%}, {% endif -%}
37 {%- endfor -%}
38 ) = 0;
39 };
40 {% endif %}
41 virtual void {{command.name}}(ErrorString*
42 {%- for parameter in command.parameters -%}
43 {%- if "optional" in parameter -%}
44 , const Maybe<{{resolve_type(parameter).raw_type}}>& in_{{parameter.name }}
45 {%- else -%}
46 , {{resolve_type(parameter).pass_type}} in_{{parameter.name}}
47 {%- endif -%}
48 {%- endfor -%}
49 {%- if "async" in command -%}
50 , std::unique_ptr<{{command.name | to_title_case}}Callback> callback
51 {%- else -%}
52 {%- for parameter in command.returns -%}
53 {%- if "optional" in parameter -%}
54 , Maybe<{{resolve_type(parameter).raw_type}}>* out_{{parameter.name}}
55 {%- else -%}
56 , {{resolve_type(parameter).type}}* out_{{parameter.name}}
57 {%- endif -%}
58 {%- endfor -%}
59 {%- endif -%}
60 ) = 0;
61 {% endfor %}
62
63 protected:
64 virtual ~Backend() { }
65 };
66
67 } // namespace {{domain.domain}}
68
69 {% endfor %}
70
71 } // namespace protocol
72 } // namespace blink
73
74 #endif // !defined({{class_name}}_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698