Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2877203002: Don't allow RenderFrames to be created during WebContents destruction. (Closed)
Patch Set: Initial patch Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/render_frame_host_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 2f7909aa9f906ebdb243e26e6322a4379a535aad..90928316e1f19e40b0d78be20c8997b54c72adbc 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1067,6 +1067,12 @@ bool RenderFrameHostImpl::CreateRenderFrame(int proxy_routing_id,
}
void RenderFrameHostImpl::SetRenderFrameCreated(bool created) {
+ // We should not create new RenderFrames while our delegate is being destroyed
+ // (e.g., via a WebContentsObserver during WebContents shutdown). This seems
+ // to have caused crashes in https://crbug.com/717650.
+ if (created && delegate_)
+ CHECK(!delegate_->IsBeingDestroyed());
+
bool was_created = render_frame_created_;
render_frame_created_ = created;
« no previous file with comments | « content/browser/frame_host/render_frame_host_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698