Index: third_party/inspector_protocol/templates/TypeBuilder_cpp.template |
diff --git a/third_party/inspector_protocol/templates/TypeBuilder_cpp.template b/third_party/inspector_protocol/templates/TypeBuilder_cpp.template |
index efb1c849eca7fe0e3104600631f62b6bb6f33f3b..f90dbd1064a8e1a8ce055b93d3b39a42367b21a6 100644 |
--- a/third_party/inspector_protocol/templates/TypeBuilder_cpp.template |
+++ b/third_party/inspector_protocol/templates/TypeBuilder_cpp.template |
@@ -355,6 +355,7 @@ DispatchResponse::Status DispatcherImpl::{{command.name}}(int callId, std::uniqu |
{% endif %} |
return response.status(); |
{% else %} |
+ std::unique_ptr<DispatcherBase::WeakPtr> weak = weakPtr(); |
std::unique_ptr<{{command.name | to_title_case}}CallbackImpl> callback(new {{command.name | to_title_case}}CallbackImpl(weakPtr(), callId, nextCallbackId())); |
m_backend->{{command.name | to_method_case}}( |
{%- for property in command.parameters -%} |
@@ -367,7 +368,7 @@ DispatchResponse::Status DispatcherImpl::{{command.name}}(int callId, std::uniqu |
{%- endfor -%} |
{%- if command.parameters -%}, {% endif -%} |
std::move(callback)); |
- return DispatchResponse::kAsync; |
+ return (weak->get() && weak->get()->lastCallbackFallThrough()) ? DispatchResponse::kFallThrough : DispatchResponse::kAsync; |
{% endif %} |
} |
{% endfor %} |