| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 } | 626 } |
| 627 | 627 |
| 628 void RenderFrameHostManager::SwapOutOldFrame( | 628 void RenderFrameHostManager::SwapOutOldFrame( |
| 629 scoped_ptr<RenderFrameHostImpl> old_render_frame_host) { | 629 scoped_ptr<RenderFrameHostImpl> old_render_frame_host) { |
| 630 TRACE_EVENT1("navigation", "RenderFrameHostManager::SwapOutOldFrame", | 630 TRACE_EVENT1("navigation", "RenderFrameHostManager::SwapOutOldFrame", |
| 631 "FrameTreeNode id", frame_tree_node_->frame_tree_node_id()); | 631 "FrameTreeNode id", frame_tree_node_->frame_tree_node_id()); |
| 632 | 632 |
| 633 // Tell the renderer to suppress any further modal dialogs so that we can swap | 633 // Tell the renderer to suppress any further modal dialogs so that we can swap |
| 634 // it out. This must be done before canceling any current dialog, in case | 634 // it out. This must be done before canceling any current dialog, in case |
| 635 // there is a loop creating additional dialogs. | 635 // there is a loop creating additional dialogs. |
| 636 // TODO(creis): Handle modal dialogs in subframe processes. | 636 old_render_frame_host->SuppressFurtherDialogs(); |
| 637 old_render_frame_host->render_view_host()->SuppressDialogsUntilSwapOut(); | |
| 638 | 637 |
| 639 // Now close any modal dialogs that would prevent us from swapping out. This | 638 // Now close any modal dialogs that would prevent us from swapping out. This |
| 640 // must be done separately from SwapOut, so that the PageGroupLoadDeferrer is | 639 // must be done separately from SwapOut, so that the ScopedPageLoadDeferrer is |
| 641 // no longer on the stack when we send the SwapOut message. | 640 // no longer on the stack when we send the SwapOut message. |
| 642 delegate_->CancelModalDialogsForRenderManager(); | 641 delegate_->CancelModalDialogsForRenderManager(); |
| 643 | 642 |
| 644 // If the old RFH is not live, just return as there is no further work to do. | 643 // If the old RFH is not live, just return as there is no further work to do. |
| 645 // It will be deleted and there will be no proxy created. | 644 // It will be deleted and there will be no proxy created. |
| 646 if (!old_render_frame_host->IsRenderFrameLive()) | 645 if (!old_render_frame_host->IsRenderFrameLive()) |
| 647 return; | 646 return; |
| 648 | 647 |
| 649 // If there are no active frames besides this one, we can delete the old | 648 // If there are no active frames besides this one, we can delete the old |
| 650 // RenderFrameHost once it runs its unload handler, without replacing it with | 649 // RenderFrameHost once it runs its unload handler, without replacing it with |
| (...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2566 } else if (pending_render_frame_host_) { | 2565 } else if (pending_render_frame_host_) { |
| 2567 send_msg(pending_render_frame_host_.get(), | 2566 send_msg(pending_render_frame_host_.get(), |
| 2568 pending_render_frame_host_->GetRoutingID(), msg); | 2567 pending_render_frame_host_->GetRoutingID(), msg); |
| 2569 } | 2568 } |
| 2570 | 2569 |
| 2571 msg->set_routing_id(render_frame_host_->GetRoutingID()); | 2570 msg->set_routing_id(render_frame_host_->GetRoutingID()); |
| 2572 render_frame_host_->Send(msg); | 2571 render_frame_host_->Send(msg); |
| 2573 } | 2572 } |
| 2574 | 2573 |
| 2575 } // namespace content | 2574 } // namespace content |
| OLD | NEW |