| 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_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 NOTREACHED() << "RFH should be in default state when calling SwapOut."; | 810 NOTREACHED() << "RFH should be in default state when calling SwapOut."; |
| 811 return; | 811 return; |
| 812 } | 812 } |
| 813 | 813 |
| 814 SetState(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT); | 814 SetState(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT); |
| 815 swapout_event_monitor_timeout_->Start( | 815 swapout_event_monitor_timeout_->Start( |
| 816 base::TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS)); | 816 base::TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS)); |
| 817 | 817 |
| 818 // There may be no proxy if there are no active views in the process. | 818 // There may be no proxy if there are no active views in the process. |
| 819 int proxy_routing_id = MSG_ROUTING_NONE; | 819 int proxy_routing_id = MSG_ROUTING_NONE; |
| 820 FrameReplicationState replication_state; |
| 820 if (proxy) { | 821 if (proxy) { |
| 821 set_render_frame_proxy_host(proxy); | 822 set_render_frame_proxy_host(proxy); |
| 822 proxy_routing_id = proxy->GetRoutingID(); | 823 proxy_routing_id = proxy->GetRoutingID(); |
| 824 replication_state = proxy->frame_tree_node()->current_replication_state(); |
| 823 } | 825 } |
| 824 | 826 |
| 825 if (IsRenderFrameLive()) | 827 if (IsRenderFrameLive()) { |
| 826 Send(new FrameMsg_SwapOut(routing_id_, proxy_routing_id)); | 828 Send(new FrameMsg_SwapOut(routing_id_, proxy_routing_id, |
| 829 replication_state)); |
| 830 } |
| 827 | 831 |
| 828 if (!GetParent()) | 832 if (!GetParent()) |
| 829 delegate_->SwappedOut(this); | 833 delegate_->SwappedOut(this); |
| 830 } | 834 } |
| 831 | 835 |
| 832 void RenderFrameHostImpl::OnBeforeUnloadACK( | 836 void RenderFrameHostImpl::OnBeforeUnloadACK( |
| 833 bool proceed, | 837 bool proceed, |
| 834 const base::TimeTicks& renderer_before_unload_start_time, | 838 const base::TimeTicks& renderer_before_unload_start_time, |
| 835 const base::TimeTicks& renderer_before_unload_end_time) { | 839 const base::TimeTicks& renderer_before_unload_end_time) { |
| 836 TRACE_EVENT_ASYNC_END0( | 840 TRACE_EVENT_ASYNC_END0( |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1688 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
| 1685 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1689 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
| 1686 GetContentClient()->browser()->RegisterPermissionUsage( | 1690 GetContentClient()->browser()->RegisterPermissionUsage( |
| 1687 PERMISSION_GEOLOCATION, | 1691 PERMISSION_GEOLOCATION, |
| 1688 delegate_->GetAsWebContents(), | 1692 delegate_->GetAsWebContents(), |
| 1689 GetLastCommittedURL().GetOrigin(), | 1693 GetLastCommittedURL().GetOrigin(), |
| 1690 top_frame->GetLastCommittedURL().GetOrigin()); | 1694 top_frame->GetLastCommittedURL().GetOrigin()); |
| 1691 } | 1695 } |
| 1692 | 1696 |
| 1693 } // namespace content | 1697 } // namespace content |
| OLD | NEW |