Index: third_party/inspector_protocol/templates/TypeBuilder_h.template |
diff --git a/third_party/inspector_protocol/templates/TypeBuilder_h.template b/third_party/inspector_protocol/templates/TypeBuilder_h.template |
index 802a16fd657aa7de273a13ac44fa7f9fe5886cd5..1d5a57bdc308923774d0f34d34a635f8f60d5712 100644 |
--- a/third_party/inspector_protocol/templates/TypeBuilder_h.template |
+++ b/third_party/inspector_protocol/templates/TypeBuilder_h.template |
@@ -196,40 +196,25 @@ public: |
virtual void sendSuccess( |
{%- for parameter in command.returns -%} |
{%- if "optional" in parameter -%} |
- {%- if new_style(domain) -%} |
Maybe<{{resolve_type(parameter).raw_type}}> {{parameter.name}} |
- {%- else -%} |
- const Maybe<{{resolve_type(parameter).raw_type}}>& {{parameter.name}} |
- {%- endif -%} |
{%- else -%} |
{{resolve_type(parameter).pass_type}} {{parameter.name}} |
{%- endif -%} |
{%- if not loop.last -%}, {% endif -%} |
{%- endfor -%} |
) = 0; |
- {% if new_style(domain) %} |
virtual void sendFailure(const DispatchResponse&) = 0; |
- {% else %} |
- virtual void sendFailure(const ErrorString&) = 0; |
- {% endif %} |
}; |
{% endif %} |
- {%- if not("async" in command) and new_style(domain) %} |
+ {%- if not("async" in command) %} |
virtual DispatchResponse {{command.name}}( |
{%- else %} |
virtual void {{command.name}}( |
{%- endif %} |
- {%- if not("async" in command) and not new_style(domain) -%} |
- ErrorString* |
- {%- endif -%} |
{%- for parameter in command.parameters -%} |
- {%- if (not loop.first) or (not ("async" in command) and not new_style(domain)) -%}, {% endif -%} |
+ {%- if not loop.first -%}, {% endif -%} |
{%- if "optional" in parameter -%} |
- {%- if new_style(domain) -%} |
Maybe<{{resolve_type(parameter).raw_type}}> in_{{parameter.name}} |
- {%- else -%} |
- const Maybe<{{resolve_type(parameter).raw_type}}>& in_{{parameter.name}} |
- {%- endif -%} |
{%- else -%} |
{{resolve_type(parameter).pass_type}} in_{{parameter.name}} |
{%- endif -%} |
@@ -239,7 +224,7 @@ public: |
std::unique_ptr<{{command.name | to_title_case}}Callback> callback |
{%- else -%} |
{%- for parameter in command.returns -%} |
- {%- if (not loop.first) or command.parameters or not new_style(domain) -%}, {% endif -%} |
+ {%- if (not loop.first) or command.parameters -%}, {% endif -%} |
{%- if "optional" in parameter -%} |
Maybe<{{resolve_type(parameter).raw_type}}>* out_{{parameter.name}} |
{%- else -%} |
@@ -251,26 +236,11 @@ public: |
{% endfor %} |
{% if not has_disable(domain.commands) %} |
- {% if new_style(domain) %} |
virtual DispatchResponse disable() |
{ |
return DispatchResponse::OK(); |
} |
- {% else %} |
- virtual void disable(ErrorString*) { } |
- {% endif %} |
{% endif %} |
- |
- // TODO(dgozman): remove once all domains migrated. |
- static void disableMe(Backend* backend) |
- { |
- {% if new_style(domain) %} |
- backend->disable(); |
- {% else %} |
- ErrorString error; |
- backend->disable(&error); |
- {% endif %} |
- } |
}; |
// ------------- Frontend interface. |
@@ -283,11 +253,7 @@ public: |
void {{event.name}}( |
{%- for parameter in event.parameters -%} |
{%- if "optional" in parameter -%} |
- {%- if new_style(domain) -%} |
Maybe<{{resolve_type(parameter).raw_type}}> {{parameter.name}} = Maybe<{{resolve_type(parameter).raw_type}}>() |
- {%- else -%} |
- const Maybe<{{resolve_type(parameter).raw_type}}>& {{parameter.name}} = Maybe<{{resolve_type(parameter).raw_type}}>() |
- {%- endif -%} |
{%- else -%} |
{{resolve_type(parameter).pass_type}} {{parameter.name}} |
{%- endif -%}{%- if not loop.last -%}, {% endif -%} |