OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 if (suspended_nav_params_) | 570 if (suspended_nav_params_) |
571 suspended_nav_params_.reset(); | 571 suspended_nav_params_.reset(); |
572 navigations_suspended_ = false; | 572 navigations_suspended_ = false; |
573 } | 573 } |
574 | 574 |
575 void RenderViewHostImpl::SuppressDialogsUntilSwapOut() { | 575 void RenderViewHostImpl::SuppressDialogsUntilSwapOut() { |
576 Send(new ViewMsg_SuppressDialogsUntilSwapOut(GetRoutingID())); | 576 Send(new ViewMsg_SuppressDialogsUntilSwapOut(GetRoutingID())); |
577 } | 577 } |
578 | 578 |
579 void RenderViewHostImpl::SwapOut() { | 579 void RenderViewHostImpl::SwapOut() { |
| 580 // If this RenderViewHost is not in the default state, it must have already |
| 581 // gone through this, therefore just return. |
| 582 if (rvh_state_ != STATE_DEFAULT) |
| 583 return; |
| 584 |
580 SetState(STATE_WAITING_FOR_UNLOAD_ACK); | 585 SetState(STATE_WAITING_FOR_UNLOAD_ACK); |
581 unload_event_monitor_timeout_->Start( | 586 unload_event_monitor_timeout_->Start( |
582 base::TimeDelta::FromMilliseconds(kUnloadTimeoutMS)); | 587 base::TimeDelta::FromMilliseconds(kUnloadTimeoutMS)); |
583 | 588 |
584 if (IsRenderViewLive()) { | 589 if (IsRenderViewLive()) { |
585 Send(new ViewMsg_SwapOut(GetRoutingID())); | 590 Send(new ViewMsg_SwapOut(GetRoutingID())); |
586 } | 591 } |
587 delegate_->SwappedOut(this); | 592 delegate_->SwappedOut(this); |
588 } | 593 } |
589 | 594 |
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 return true; | 1935 return true; |
1931 } | 1936 } |
1932 | 1937 |
1933 void RenderViewHostImpl::AttachToFrameTree() { | 1938 void RenderViewHostImpl::AttachToFrameTree() { |
1934 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1939 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1935 | 1940 |
1936 frame_tree->ResetForMainFrameSwap(); | 1941 frame_tree->ResetForMainFrameSwap(); |
1937 } | 1942 } |
1938 | 1943 |
1939 } // namespace content | 1944 } // namespace content |
OLD | NEW |