summaryrefslogtreecommitdiff
path: root/chromium/content/browser/portal/portal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/portal/portal.cc')
-rw-r--r--chromium/content/browser/portal/portal.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chromium/content/browser/portal/portal.cc b/chromium/content/browser/portal/portal.cc
index 2565b98545c..aef23d78547 100644
--- a/chromium/content/browser/portal/portal.cc
+++ b/chromium/content/browser/portal/portal.cc
@@ -606,6 +606,11 @@ void Portal::ActivateImpl(blink::TransferableMessage data,
devtools_instrumentation::PortalActivated(outer_contents->GetMainFrame());
successor_contents_raw->set_portal(nullptr);
+ // It's important we call this before destroying the outer contents'
+ // RenderWidgetHostView, otherwise the dialog may not be cleaned up correctly.
+ // See crbug.com/1292261 for more details.
+ outer_contents->CancelActiveAndPendingDialogs();
+
std::unique_ptr<WebContents> predecessor_web_contents =
delegate->ActivatePortalWebContents(outer_contents,
std::move(successor_contents));