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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2646613002: ShowCreatedWindow: some speculative fixes for 680876. (Closed)
Patch Set: Switch to DWOC. Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 7c02ea952f1947a89bcb3bb6ccf7665ba9b45549..a98821caf67ec1aae45cc8649b3afd8ed25b4982 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2116,6 +2116,8 @@ void WebContentsImpl::CreateNewWindow(
// Save the created window associated with the route so we can show it
// later.
DCHECK_NE(MSG_ROUTING_NONE, main_frame_widget_route_id);
+ CHECK(RenderWidgetHostImpl::FromID(render_process_id,
+ main_frame_widget_route_id));
pending_contents_[std::make_pair(
render_process_id, main_frame_widget_route_id)] = new_contents;
AddDestructionObserver(new_contents);
@@ -2216,6 +2218,14 @@ void WebContentsImpl::ShowCreatedWindow(int process_id,
WebContentsImpl* contents =
GetCreatedWindow(process_id, main_frame_widget_route_id);
if (contents) {
+ RenderWidgetHostImpl* rwh =
+ RenderWidgetHostImpl::FromID(process_id, main_frame_widget_route_id);
+ if (!rwh) {
+ // TODO(nick): Temporary for https://crbug.com/680876
+ base::debug::DumpWithoutCrashing();
+ return;
+ }
+
WebContentsDelegate* delegate = GetDelegate();
contents->is_resume_pending_ = true;
if (!delegate || delegate->ShouldResumeRequestsForCreatedWindow())
@@ -2226,8 +2236,6 @@ void WebContentsImpl::ShowCreatedWindow(int process_id,
user_gesture, NULL);
}
- RenderWidgetHostImpl* rwh = contents->GetMainFrame()->GetRenderWidgetHost();
- DCHECK_EQ(main_frame_widget_route_id, rwh->GetRoutingID());
rwh->Send(new ViewMsg_Move_ACK(rwh->GetRoutingID()));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698