| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 Send(new FrameMsg_SwapOut(routing_id_, proxy->GetRoutingID(), is_loading, | 1485 Send(new FrameMsg_SwapOut(routing_id_, proxy->GetRoutingID(), is_loading, |
| 1486 replication_state)); | 1486 replication_state)); |
| 1487 } | 1487 } |
| 1488 | 1488 |
| 1489 if (web_ui()) | 1489 if (web_ui()) |
| 1490 web_ui()->RenderFrameHostSwappingOut(); | 1490 web_ui()->RenderFrameHostSwappingOut(); |
| 1491 | 1491 |
| 1492 // TODO(nasko): If the frame is not live, the RFH should just be deleted by | 1492 // TODO(nasko): If the frame is not live, the RFH should just be deleted by |
| 1493 // simulating the receipt of swap out ack. | 1493 // simulating the receipt of swap out ack. |
| 1494 is_waiting_for_swapout_ack_ = true; | 1494 is_waiting_for_swapout_ack_ = true; |
| 1495 if (frame_tree_node_->IsMainFrame()) |
| 1496 render_view_host_->set_is_active(false); |
| 1495 } | 1497 } |
| 1496 | 1498 |
| 1497 void RenderFrameHostImpl::OnBeforeUnloadACK( | 1499 void RenderFrameHostImpl::OnBeforeUnloadACK( |
| 1498 bool proceed, | 1500 bool proceed, |
| 1499 const base::TimeTicks& renderer_before_unload_start_time, | 1501 const base::TimeTicks& renderer_before_unload_start_time, |
| 1500 const base::TimeTicks& renderer_before_unload_end_time) { | 1502 const base::TimeTicks& renderer_before_unload_end_time) { |
| 1501 TRACE_EVENT_ASYNC_END1("navigation", "RenderFrameHostImpl BeforeUnload", this, | 1503 TRACE_EVENT_ASYNC_END1("navigation", "RenderFrameHostImpl BeforeUnload", this, |
| 1502 "FrameTreeNode id", | 1504 "FrameTreeNode id", |
| 1503 frame_tree_node_->frame_tree_node_id()); | 1505 frame_tree_node_->frame_tree_node_id()); |
| 1504 // If this renderer navigated while the beforeunload request was in flight, we | 1506 // If this renderer navigated while the beforeunload request was in flight, we |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 // Ignore spurious swap out ack. | 1654 // Ignore spurious swap out ack. |
| 1653 if (!is_waiting_for_swapout_ack_) | 1655 if (!is_waiting_for_swapout_ack_) |
| 1654 return; | 1656 return; |
| 1655 | 1657 |
| 1656 TRACE_EVENT_ASYNC_END0("navigation", "RenderFrameHostImpl::SwapOut", this); | 1658 TRACE_EVENT_ASYNC_END0("navigation", "RenderFrameHostImpl::SwapOut", this); |
| 1657 if (swapout_event_monitor_timeout_) | 1659 if (swapout_event_monitor_timeout_) |
| 1658 swapout_event_monitor_timeout_->Stop(); | 1660 swapout_event_monitor_timeout_->Stop(); |
| 1659 | 1661 |
| 1660 ClearAllWebUI(); | 1662 ClearAllWebUI(); |
| 1661 | 1663 |
| 1664 // If this is a main frame RFH that's about to be deleted, update its RVH's |
| 1665 // swapped-out state here. https://crbug.com/505887 |
| 1666 if (frame_tree_node_->IsMainFrame()) { |
| 1667 render_view_host_->set_is_active(false); |
| 1668 render_view_host_->set_is_swapped_out(true); |
| 1669 } |
| 1670 |
| 1662 bool deleted = | 1671 bool deleted = |
| 1663 frame_tree_node_->render_manager()->DeleteFromPendingList(this); | 1672 frame_tree_node_->render_manager()->DeleteFromPendingList(this); |
| 1664 CHECK(deleted); | 1673 CHECK(deleted); |
| 1665 } | 1674 } |
| 1666 | 1675 |
| 1667 void RenderFrameHostImpl::DisableSwapOutTimerForTesting() { | 1676 void RenderFrameHostImpl::DisableSwapOutTimerForTesting() { |
| 1668 swapout_event_monitor_timeout_.reset(); | 1677 swapout_event_monitor_timeout_.reset(); |
| 1669 } | 1678 } |
| 1670 | 1679 |
| 1671 void RenderFrameHostImpl::OnRendererConnect( | 1680 void RenderFrameHostImpl::OnRendererConnect( |
| (...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3631 service_manager::mojom::InterfaceProviderPtr provider; | 3640 service_manager::mojom::InterfaceProviderPtr provider; |
| 3632 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this); | 3641 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this); |
| 3633 java_interfaces_.reset(new service_manager::InterfaceProvider); | 3642 java_interfaces_.reset(new service_manager::InterfaceProvider); |
| 3634 java_interfaces_->Bind(std::move(provider)); | 3643 java_interfaces_->Bind(std::move(provider)); |
| 3635 } | 3644 } |
| 3636 return java_interfaces_.get(); | 3645 return java_interfaces_.get(); |
| 3637 } | 3646 } |
| 3638 #endif | 3647 #endif |
| 3639 | 3648 |
| 3640 } // namespace content | 3649 } // namespace content |
| OLD | NEW |