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

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

Issue 2242493002: Send RenderViewReady when a RVH is reused and becomes active. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Charlie's nit and Windows test fix Created 4 years, 4 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 | content/browser/frame_host/render_frame_host_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 651c3590e50df1020770698e46d306bf1b358b2a..d9a98008539e270f9cddaeb70624ea0ee9d41f1e 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2145,10 +2145,21 @@ void RenderFrameHostManager::CommitPending() {
// routing id in the RenderViewHost associated with the old RenderFrameHost
// to MSG_ROUTING_NONE.
if (is_main_frame) {
- render_frame_host_->render_view_host()->set_main_frame_routing_id(
- render_frame_host_->routing_id());
- render_frame_host_->render_view_host()->set_is_active(true);
- render_frame_host_->render_view_host()->set_is_swapped_out(false);
+ RenderViewHostImpl* rvh = render_frame_host_->render_view_host();
+ rvh->set_main_frame_routing_id(render_frame_host_->routing_id());
+
+ // If the RenderViewHost is transitioning from swapped out to active state,
+ // it was reused, so dispatch a RenderViewReady event. For example, this
+ // is necessary to hide the sad tab if one is currently displayed. See
+ // https://crbug.com/591984.
+ //
+ // TODO(alexmos): Remove this and move RenderViewReady consumers to use
+ // the main frame's RenderFrameCreated instead.
+ if (!rvh->is_active())
+ rvh->PostRenderViewReady();
+
+ rvh->set_is_active(true);
+ rvh->set_is_swapped_out(false);
old_render_frame_host->render_view_host()->set_main_frame_routing_id(
MSG_ROUTING_NONE);
}
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698