Commit c67836e9 authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

Fix crash in ExtensionPopup::DevToolsAgentHostDetached upon extension unload

ExtensionPopup::OnExtensionUnloaded() deletes the ExtensionHost,
we destroy the WebContents, this leads to detaching of DevTools
sessions which will be reported to
ExtensionPopup::DevToolsAgentHostDetached where we access host.
Oops.

Bug: 1052057
Change-Id: I34e03582beb61c0308ad35bc973dc5cd4e26a5b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066506
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarJohannes Henkel <johannes@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746168}
parent 34b06d0e
...@@ -167,6 +167,12 @@ void ExtensionPopup::DevToolsAgentHostAttached( ...@@ -167,6 +167,12 @@ void ExtensionPopup::DevToolsAgentHostAttached(
void ExtensionPopup::DevToolsAgentHostDetached( void ExtensionPopup::DevToolsAgentHostDetached(
content::DevToolsAgentHost* agent_host) { content::DevToolsAgentHost* agent_host) {
// If the extension's page is open it will be closed when the extension
// is uninstalled, and if DevTools are attached, we will be notified here.
// But because OnExtensionUnloaded was already called, |host_| is
// no longer valid.
if (!host())
return;
if (host()->host_contents() == agent_host->GetWebContents()) if (host()->host_contents() == agent_host->GetWebContents())
show_action_ = SHOW; show_action_ = SHOW;
} }
......
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