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

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

Issue 642813007: Drop CreateChildFrame messages when swapping out. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 436f4fbad1ac99df7ec45e782d7218d9f4df1774..9543334e9da3d5fc8b8105e8bff0192bf3e34a5d 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -611,6 +611,13 @@ void RenderFrameHostImpl::OnAddMessageToConsole(
void RenderFrameHostImpl::OnCreateChildFrame(int new_routing_id,
const std::string& frame_name) {
+ // It is possible that while a new RenderFrameHost was committed, the
+ // RenderFrame corresponding to this host sent an IPC message to create a
+ // frame and it is delivered after this host is swapped out.
+ // Ignore such messages, as we know this RenderFrameHost is going away.
+ if (rfh_state_ != RenderFrameHostImpl::STATE_DEFAULT)
+ return;
+
RenderFrameHostImpl* new_frame = frame_tree_->AddFrame(
Charlie Reis 2014/10/15 23:54:18 FrameTree::AddFrame is still a problematic API, in
nasko 2014/10/16 17:08:36 No need for follow up CL. Let's do it right from t
frame_tree_node_, new_routing_id, frame_name);

Powered by Google App Engine
This is Rietveld 408576698