| 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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 void ActiveFrameCountIsZero(SiteInstanceImpl* site_instance) override; | 508 void ActiveFrameCountIsZero(SiteInstanceImpl* site_instance) override; |
| 509 void RenderProcessGone(SiteInstanceImpl* site_instance) override; | 509 void RenderProcessGone(SiteInstanceImpl* site_instance) override; |
| 510 | 510 |
| 511 // Sets up the necessary state for a new RenderViewHost. If |proxy| is not | 511 // Sets up the necessary state for a new RenderViewHost. If |proxy| is not |
| 512 // null, it creates a RenderFrameProxy in the target renderer process which is | 512 // null, it creates a RenderFrameProxy in the target renderer process which is |
| 513 // used to route IPC messages when in swapped out state. Returns early if the | 513 // used to route IPC messages when in swapped out state. Returns early if the |
| 514 // RenderViewHost has already been initialized for another RenderFrameHost. | 514 // RenderViewHost has already been initialized for another RenderFrameHost. |
| 515 bool InitRenderView(RenderViewHostImpl* render_view_host, | 515 bool InitRenderView(RenderViewHostImpl* render_view_host, |
| 516 RenderFrameProxyHost* proxy); | 516 RenderFrameProxyHost* proxy); |
| 517 | 517 |
| 518 // Terminates and deletes the pending RenderFrameHost. |
| 519 void CancelPending(); |
| 520 |
| 518 private: | 521 private: |
| 519 friend class NavigatorTestWithBrowserSideNavigation; | 522 friend class NavigatorTestWithBrowserSideNavigation; |
| 520 friend class RenderFrameHostManagerTest; | 523 friend class RenderFrameHostManagerTest; |
| 521 friend class TestWebContents; | 524 friend class TestWebContents; |
| 522 | 525 |
| 523 enum class SiteInstanceRelation { | 526 enum class SiteInstanceRelation { |
| 524 // A SiteInstance in a different browsing instance from the current. | 527 // A SiteInstance in a different browsing instance from the current. |
| 525 UNRELATED, | 528 UNRELATED, |
| 526 // A SiteInstance in the same browsing instance as the current. | 529 // A SiteInstance in the same browsing instance as the current. |
| 527 RELATED, | 530 RELATED, |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 // RenderFrameHost has committed. |old_render_frame_host| will either be | 706 // RenderFrameHost has committed. |old_render_frame_host| will either be |
| 704 // deleted or put on the pending delete list during this call. | 707 // deleted or put on the pending delete list during this call. |
| 705 void SwapOutOldFrame( | 708 void SwapOutOldFrame( |
| 706 std::unique_ptr<RenderFrameHostImpl> old_render_frame_host); | 709 std::unique_ptr<RenderFrameHostImpl> old_render_frame_host); |
| 707 | 710 |
| 708 // Discards a RenderFrameHost that was never made active (for active ones | 711 // Discards a RenderFrameHost that was never made active (for active ones |
| 709 // SwapOutOldFrame is used instead). | 712 // SwapOutOldFrame is used instead). |
| 710 void DiscardUnusedFrame( | 713 void DiscardUnusedFrame( |
| 711 std::unique_ptr<RenderFrameHostImpl> render_frame_host); | 714 std::unique_ptr<RenderFrameHostImpl> render_frame_host); |
| 712 | 715 |
| 713 // Helper method to terminate the pending RenderFrameHost. The frame may be | |
| 714 // deleted immediately, or it may be kept around in hopes of later reuse. | |
| 715 void CancelPending(); | |
| 716 | |
| 717 // Clears pending_render_frame_host_, returning it to the caller for disposal. | 716 // Clears pending_render_frame_host_, returning it to the caller for disposal. |
| 718 std::unique_ptr<RenderFrameHostImpl> UnsetPendingRenderFrameHost(); | 717 std::unique_ptr<RenderFrameHostImpl> UnsetPendingRenderFrameHost(); |
| 719 | 718 |
| 720 // Helper method to set the active RenderFrameHost. Returns the old | 719 // Helper method to set the active RenderFrameHost. Returns the old |
| 721 // RenderFrameHost and updates counts. | 720 // RenderFrameHost and updates counts. |
| 722 std::unique_ptr<RenderFrameHostImpl> SetRenderFrameHost( | 721 std::unique_ptr<RenderFrameHostImpl> SetRenderFrameHost( |
| 723 std::unique_ptr<RenderFrameHostImpl> render_frame_host); | 722 std::unique_ptr<RenderFrameHostImpl> render_frame_host); |
| 724 | 723 |
| 725 RenderFrameHostImpl* UpdateStateForNavigate( | 724 RenderFrameHostImpl* UpdateStateForNavigate( |
| 726 const GURL& dest_url, | 725 const GURL& dest_url, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; | 802 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; |
| 804 | 803 |
| 805 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 804 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 806 | 805 |
| 807 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 806 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 808 }; | 807 }; |
| 809 | 808 |
| 810 } // namespace content | 809 } // namespace content |
| 811 | 810 |
| 812 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 811 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |