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

Unified Diff: templates/TypeBuilder_h.template

Issue 2477823002: [inspector_protocol] remove old style domains support (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « templates/TypeBuilder_cpp.template ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: templates/TypeBuilder_h.template
diff --git a/templates/TypeBuilder_h.template b/templates/TypeBuilder_h.template
index 802a16fd657aa7de273a13ac44fa7f9fe5886cd5..1d5a57bdc308923774d0f34d34a635f8f60d5712 100644
--- a/templates/TypeBuilder_h.template
+++ b/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 -%}
« no previous file with comments | « templates/TypeBuilder_cpp.template ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698