Commit 96ed9b3f authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

[OOPIF] Add debugging checks for IPC races between view and frame close.

It's unclear how this is happening: one possibility is there's a race
between WebWidget::Close() actually being invoked in the renderer (it is
currently triggered via a non-nestable posted task) and the browser
state being torn down (which sends FrameMsg_Delete from the destructor
of RenderFrameHostImpl).

Bug: 838348
Change-Id: If98c4f104a27f39e083f45f6cd335b326a3976e0
Reviewed-on: https://chromium-review.googlesource.com/1067577Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560383}
parent 45c07e54
......@@ -1944,6 +1944,15 @@ void RenderFrameImpl::OnDeleteFrame() {
// See https://crbug.com/569683 for details.
in_browser_initiated_detach_ = true;
bool is_closing = render_view_->closing();
base::debug::Alias(&is_closing);
// It is an error to tell a main RenderFrame to cleanup itself, unless the
// RenderFrame is provisonal. But since WebView::Close() is deferred (see
// RenderWidget::OnClose, which posts a non-nestable task for the actual
// WebWidget::Close() invocation), perhaps this is happening somehow...
if (is_main_frame_ && !frame_->IsProvisional())
CHECK(false);
// This will result in a call to RenderFrameImpl::frameDetached, which
// deletes the object. Do not access |this| after detach.
frame_->Detach();
......
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