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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 NOTREACHED() << "RFH should be in default state when calling SwapOut."; | 749 NOTREACHED() << "RFH should be in default state when calling SwapOut."; |
750 return; | 750 return; |
751 } | 751 } |
752 | 752 |
753 SetState(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT); | 753 SetState(RenderFrameHostImpl::STATE_PENDING_SWAP_OUT); |
754 swapout_event_monitor_timeout_->Start( | 754 swapout_event_monitor_timeout_->Start( |
755 base::TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS)); | 755 base::TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS)); |
756 | 756 |
757 // There may be no proxy if there are no active views in the process. | 757 // There may be no proxy if there are no active views in the process. |
758 int proxy_routing_id = MSG_ROUTING_NONE; | 758 int proxy_routing_id = MSG_ROUTING_NONE; |
| 759 FrameReplicationState replication_state; |
759 if (proxy) { | 760 if (proxy) { |
760 set_render_frame_proxy_host(proxy); | 761 set_render_frame_proxy_host(proxy); |
761 proxy_routing_id = proxy->GetRoutingID(); | 762 proxy_routing_id = proxy->GetRoutingID(); |
| 763 replication_state = proxy->frame_tree_node()->current_replication_state(); |
762 } | 764 } |
763 | 765 |
764 if (IsRenderFrameLive()) | 766 if (IsRenderFrameLive()) { |
765 Send(new FrameMsg_SwapOut(routing_id_, proxy_routing_id)); | 767 Send(new FrameMsg_SwapOut(routing_id_, proxy_routing_id, |
| 768 replication_state)); |
| 769 } |
766 | 770 |
767 if (!GetParent()) | 771 if (!GetParent()) |
768 delegate_->SwappedOut(this); | 772 delegate_->SwappedOut(this); |
769 } | 773 } |
770 | 774 |
771 void RenderFrameHostImpl::OnBeforeUnloadACK( | 775 void RenderFrameHostImpl::OnBeforeUnloadACK( |
772 bool proceed, | 776 bool proceed, |
773 const base::TimeTicks& renderer_before_unload_start_time, | 777 const base::TimeTicks& renderer_before_unload_start_time, |
774 const base::TimeTicks& renderer_before_unload_end_time) { | 778 const base::TimeTicks& renderer_before_unload_end_time) { |
775 TRACE_EVENT_ASYNC_END0( | 779 TRACE_EVENT_ASYNC_END0( |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1572 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1576 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
1573 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1577 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
1574 GetContentClient()->browser()->RegisterPermissionUsage( | 1578 GetContentClient()->browser()->RegisterPermissionUsage( |
1575 PERMISSION_GEOLOCATION, | 1579 PERMISSION_GEOLOCATION, |
1576 delegate_->GetAsWebContents(), | 1580 delegate_->GetAsWebContents(), |
1577 GetLastCommittedURL().GetOrigin(), | 1581 GetLastCommittedURL().GetOrigin(), |
1578 top_frame->GetLastCommittedURL().GetOrigin()); | 1582 top_frame->GetLastCommittedURL().GetOrigin()); |
1579 } | 1583 } |
1580 | 1584 |
1581 } // namespace content | 1585 } // namespace content |
OLD | NEW |