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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 464593003: Don't swap out the old RenderFrameHost until the new one commits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Major rebase Created 6 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
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 267d690be28b66b93e3fccc5d5bf6f4dfe35c539..2a1cb0398c26f4e62e33eae8578a63d2cb820f06 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -139,8 +139,6 @@ const int RenderViewHostImpl::kUnloadTimeoutMS = 1000;
// static
bool RenderViewHostImpl::IsRVHStateActive(RenderViewHostImplState rvh_state) {
if (rvh_state == STATE_DEFAULT ||
- rvh_state == STATE_WAITING_FOR_UNLOAD_ACK ||
- rvh_state == STATE_WAITING_FOR_COMMIT ||
rvh_state == STATE_WAITING_FOR_CLOSE)
return true;
return false;
@@ -540,9 +538,6 @@ void RenderViewHostImpl::OnSwappedOut(bool timed_out) {
}
switch (rvh_state_) {
- case STATE_WAITING_FOR_UNLOAD_ACK:
- SetState(STATE_WAITING_FOR_COMMIT);
- break;
case STATE_PENDING_SWAP_OUT:
SetState(STATE_SWAPPED_OUT);
break;
@@ -555,26 +550,6 @@ void RenderViewHostImpl::OnSwappedOut(bool timed_out) {
}
}
-void RenderViewHostImpl::WasSwappedOut(
- const base::Closure& pending_delete_on_swap_out) {
- Send(new ViewMsg_WasSwappedOut(GetRoutingID()));
- if (rvh_state_ == STATE_WAITING_FOR_UNLOAD_ACK) {
- SetState(STATE_PENDING_SWAP_OUT);
- if (!instance_->active_view_count())
- SetPendingShutdown(pending_delete_on_swap_out);
- } else if (rvh_state_ == STATE_WAITING_FOR_COMMIT) {
- SetState(STATE_SWAPPED_OUT);
- } else if (rvh_state_ == STATE_DEFAULT) {
- // When the RenderView is not live, the RenderFrameHostManager will call
- // CommitPending directly, without calling SwapOut on the old RVH. This will
- // cause WasSwappedOut to be called directly on the live old RVH.
- DCHECK(!IsRenderViewLive());
- SetState(STATE_SWAPPED_OUT);
- } else {
- NOTREACHED();
- }
-}
-
void RenderViewHostImpl::SetPendingShutdown(const base::Closure& on_swap_out) {
pending_shutdown_on_swap_out_ = on_swap_out;
SetState(STATE_PENDING_SHUTDOWN);
@@ -1367,8 +1342,7 @@ void RenderViewHostImpl::DidCancelPopupMenu() {
#endif
bool RenderViewHostImpl::IsWaitingForUnloadACK() const {
- return rvh_state_ == STATE_WAITING_FOR_UNLOAD_ACK ||
- rvh_state_ == STATE_WAITING_FOR_CLOSE ||
+ return rvh_state_ == STATE_WAITING_FOR_CLOSE ||
rvh_state_ == STATE_PENDING_SHUTDOWN ||
rvh_state_ == STATE_PENDING_SWAP_OUT;
}

Powered by Google App Engine
This is Rietveld 408576698