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

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

Issue 2646613002: ShowCreatedWindow: some speculative fixes for 680876. (Closed)
Patch Set: Add a CHECK 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..7461c85e52013b06ccf25af5dd7281e0ee079e34 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);
@@ -2213,9 +2215,13 @@ void WebContentsImpl::ShowCreatedWindow(int process_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
bool user_gesture) {
+ RenderWidgetHostImpl* rwh =
+ RenderWidgetHostImpl::FromID(process_id, main_frame_widget_route_id);
+ if (!rwh)
+ return;
alexmos 2017/01/18 23:23:47 Would it help at all to add a DumpWithoutCrashing
ncarter (slow) 2017/01/19 22:04:49 Thanks for this suggestion. I've added a DumpWitho
WebContentsImpl* contents =
GetCreatedWindow(process_id, main_frame_widget_route_id);
- if (contents) {
+ if (contents && contents->GetMainFrame()->GetRenderWidgetHost() == rwh) {
alexmos 2017/01/18 23:23:47 How do you think we could get to the state where t
ncarter (slow) 2017/01/18 23:59:16 Really, I'm grasping at straws here: I don't reall
alexmos 2017/01/19 01:25:20 Agreed - an Android delegate somehow triggering a
ncarter (slow) 2017/01/19 22:04:49 I undid the equality check since I agree with you
WebContentsDelegate* delegate = GetDelegate();
contents->is_resume_pending_ = true;
if (!delegate || delegate->ShouldResumeRequestsForCreatedWindow())
@@ -2226,8 +2232,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