Commit ea4ddecc authored by Wez's avatar Wez Committed by Chromium LUCI CQ

[fuchsia] Check that controller is bound before sending OnTerminated.

|controller_binding_| may be unbound during WebComponent teardown,
causing a FIDL write error to be logged, if:
- The component was started without a ComponentController request.
- The ComponentController was previously Detach()ed and closed.
- The WebComponent is tearing down because the ComponentController
  channel was closed by the client.

The OnTerminated event is now dispatched only if |controller_binding_|
is still bound.

Bug: 1157638
Change-Id: Idd15e6cb07a98a27a56d3b5a9f8c1c611b04c816
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2584849
Auto-Submit: Wez <wez@chromium.org>
Commit-Queue: David Dorwin <ddorwin@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836171}
parent 6194f01f
......@@ -49,9 +49,11 @@ WebComponent::~WebComponent() {
if (module_context_)
module_context_->RemoveSelfFromStory();
if (controller_binding_.is_bound()) {
// Send process termination details to the client.
controller_binding_.events().OnTerminated(termination_exit_code_,
termination_reason_);
}
}
void WebComponent::EnableRemoteDebugging() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment