| 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 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 HEADLESS_PUBLIC_DEVTOOLS_DOMAINS_{{domain.domain | camelcase_to_hacker_s
tyle | upper}}_H_ | 7 #ifndef HEADLESS_PUBLIC_DEVTOOLS_DOMAINS_{{domain.domain | camelcase_to_hacker_s
tyle | upper}}_H_ |
| 8 #define HEADLESS_PUBLIC_DEVTOOLS_DOMAINS_{{domain.domain | camelcase_to_hacker_s
tyle | upper}}_H_ | 8 #define HEADLESS_PUBLIC_DEVTOOLS_DOMAINS_{{domain.domain | camelcase_to_hacker_s
tyle | upper}}_H_ |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 {% for domain_name in domain.dependencies %} | 13 {% for domain_name in domain.dependencies %} |
| (...skipping 17 matching lines...) Expand all Loading... |
| 31 {% if parameter.get("optional", False) -%} | 31 {% if parameter.get("optional", False) -%} |
| 32 {% break %} | 32 {% break %} |
| 33 {% endif %} | 33 {% endif %} |
| 34 {% if not loop.first %}, {% endif %} | 34 {% if not loop.first %}, {% endif %} |
| 35 {{resolve_type(parameter).pass_type}} {{parameter.name | camelcase_to_hacker_sty
le -}} | 35 {{resolve_type(parameter).pass_type}} {{parameter.name | camelcase_to_hacker_sty
le -}} |
| 36 {% endfor %} | 36 {% endfor %} |
| 37 {% if command.get("parameters", []) and not command.parameters[0].get("optio
nal", False) %}, {% endif %}{# -#} | 37 {% if command.get("parameters", []) and not command.parameters[0].get("optio
nal", False) %}, {% endif %}{# -#} |
| 38 {% if command.get("returns", []) -%} | 38 {% if command.get("returns", []) -%} |
| 39 base::Callback<void(std::unique_ptr<{{method_name}}Result>)> callback = ba
se::Callback<void(std::unique_ptr<{{method_name}}Result>)>(){##} | 39 base::Callback<void(std::unique_ptr<{{method_name}}Result>)> callback = ba
se::Callback<void(std::unique_ptr<{{method_name}}Result>)>(){##} |
| 40 {% else -%} | 40 {% else -%} |
| 41 base::Callback<void()> callback = base::Callback<void()>(){##} | 41 base::Closure callback = base::Closure(){##} |
| 42 {% endif %}); | 42 {% endif %}); |
| 43 {# If the command has no return value, generate a convenience method that #} | 43 {# If the command has no return value, generate a convenience method that #} |
| 44 {# accepts a base::Callback<void()> together with the parameters object. #} | 44 {# accepts a base::Closure together with the parameters object. #} |
| 45 {% if not command.get("returns", []) %} | 45 {% if not command.get("returns", []) %} |
| 46 void {{method_name}}(std::unique_ptr<{{method_name}}Params> params, base::Call
back<void()> callback); | 46 void {{method_name}}(std::unique_ptr<{{method_name}}Params> params, base::Clos
ure callback); |
| 47 {% endif %} | 47 {% endif %} |
| 48 {% endif %} | 48 {% endif %} |
| 49 {% endmacro %} | 49 {% endmacro %} |
| 50 | 50 |
| 51 namespace headless { | 51 namespace headless { |
| 52 namespace {{domain.domain | camelcase_to_hacker_style}} { | 52 namespace {{domain.domain | camelcase_to_hacker_style}} { |
| 53 class HEADLESS_EXPORT ExperimentalDomain; | 53 class HEADLESS_EXPORT ExperimentalDomain; |
| 54 class HEADLESS_EXPORT ExperimentalObserver; | 54 class HEADLESS_EXPORT ExperimentalObserver; |
| 55 {% if "events" in domain %} | 55 {% if "events" in domain %} |
| 56 | 56 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 {% endfor %} | 157 {% endfor %} |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 DISALLOW_COPY_AND_ASSIGN(ExperimentalDomain); | 160 DISALLOW_COPY_AND_ASSIGN(ExperimentalDomain); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 } // namespace {{domain.domain | camelcase_to_hacker_style}} | 163 } // namespace {{domain.domain | camelcase_to_hacker_style}} |
| 164 } // namespace headless | 164 } // namespace headless |
| 165 | 165 |
| 166 #endif // HEADLESS_PUBLIC_DEVTOOLS_DOMAINS_{{domain.domain | camelcase_to_hacke
r_style | upper}}_H_ | 166 #endif // HEADLESS_PUBLIC_DEVTOOLS_DOMAINS_{{domain.domain | camelcase_to_hacke
r_style | upper}}_H_ |
| OLD | NEW |