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

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

Issue 213413005: Ensure RenderViewHost is not shut down until a screenshot of the page is taken. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing some unit tests. Created 6 years, 9 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_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 d697e186d0c4dae004a901635c31d549514bffb9..11a5c0b78cb04ef00632127b1d2aedf062197bfc 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -500,7 +500,7 @@ void RenderFrameHostManager::DidDisownOpener(RenderViewHost* render_view_host) {
void RenderFrameHostManager::RendererProcessClosing(
RenderProcessHost* render_process_host) {
- // Remove any swapped out RVHs from this process, so that we don't try to
+ // Remove any swapped out RFHs from this process, so that we don't try to
// swap them back in while the process is exiting. Start by finding them,
// since there could be more than one.
std::list<int> ids_to_remove;
@@ -513,7 +513,15 @@ void RenderFrameHostManager::RendererProcessClosing(
// Now delete them.
while (!ids_to_remove.empty()) {
- delete swapped_out_hosts_[ids_to_remove.back()];
+ RenderFrameHostImpl* rfh = swapped_out_hosts_[ids_to_remove.back()];
+ // The pending RFH may be on the swapped out list if we started to swap it
+ // back in.
+ if (rfh == pending_render_frame_host_.get()) {
+ CancelPending();
mfomitchev 2014/03/26 18:59:30 I had to add this code because without it one of t
nasko 2014/03/26 22:48:27 Can you share which test that was?
mfomitchev 2014/03/27 21:51:34 IsolatedAppTest.CrossProcessClientRedirect. At the
+ //pending_render_frame_host_.reset();
nasko 2014/03/26 22:48:27 You don't need a reset here, CancelPending will ta
mfomitchev 2014/03/27 21:51:34 Done.
+ } else {
+ delete swapped_out_hosts_[ids_to_remove.back()];
+ }
swapped_out_hosts_.erase(ids_to_remove.back());
ids_to_remove.pop_back();
}

Powered by Google App Engine
This is Rietveld 408576698