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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template

Issue 2203543002: [DevTools] Dont pass errorString to async protocol methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template b/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template
index 1c3300a61f6521dc63d6165ad9d7978143804930..e3c2fa1de6761d367c98cb0d43c4933e49bd10bd 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/TypeBuilder_cpp.template
@@ -294,6 +294,7 @@ void DispatcherImpl::{{command.name}}(int callId, std::unique_ptr<DictionaryValu
{% endif %}
std::unique_ptr<DispatcherBase::WeakPtr> weak = weakPtr();
+ {% if not("async" in command) %}
ErrorString error;
m_backend->{{command.name}}(&error
{%- for property in command.parameters -%}
@@ -303,29 +304,38 @@ void DispatcherImpl::{{command.name}}(int callId, std::unique_ptr<DictionaryValu
, {{resolve_type(property).to_pass_type % ("in_" + property.name)}}
{%- endif -%}
{%- endfor %}
- {%- if "async" in command -%}
- , std::move(callback)
- {%- elif "returns" in command %}
+ {%- if "returns" in command %}
{%- for property in command.returns -%}
, &out_{{property.name}}
{%- endfor %}
{% endif %});
- {% if "returns" in command and not("async" in command) %}
+ {% if "returns" in command and not("async" in command) %}
if (!error.length()) {
- {% for parameter in command.returns %}
- {% if "optional" in parameter %}
+ {% for parameter in command.returns %}
+ {% if "optional" in parameter %}
if (out_{{parameter.name}}.isJust())
result->setValue("{{parameter.name}}", ValueConversions<{{resolve_type(parameter).raw_type}}>::serialize(out_{{parameter.name}}.fromJust()));
- {% else %}
+ {% else %}
result->setValue("{{parameter.name}}", ValueConversions<{{resolve_type(parameter).raw_type}}>::serialize({{resolve_type(parameter).to_raw_type % ("out_" + parameter.name)}}));
- {% endif %}
- {% endfor %}
+ {% endif %}
+ {% endfor %}
}
if (weak->get())
weak->get()->sendResponse(callId, error, std::move(result));
- {% elif not("async" in command) %}
+ {% else %}
if (weak->get())
weak->get()->sendResponse(callId, error);
+ {% endif %}
+ {%- else %}
+ m_backend->{{command.name}}(
+ {%- for property in command.parameters -%}
+ {%- if "optional" in property -%}
+ in_{{property.name}},
+ {%- else -%}
+ {{resolve_type(property).to_pass_type % ("in_" + property.name)}},
+ {%- endif -%}
+ {%- endfor -%}
+ std::move(callback));
{% endif %}
}
{% endfor %}

Powered by Google App Engine
This is Rietveld 408576698