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 10 matching lines...) Expand all Loading... |
21 #include "content/browser/site_instance_impl.h" | 21 #include "content/browser/site_instance_impl.h" |
22 #include "content/common/content_export.h" | 22 #include "content/common/content_export.h" |
23 #include "content/public/browser/global_request_id.h" | 23 #include "content/public/browser/global_request_id.h" |
24 #include "content/public/common/referrer.h" | 24 #include "content/public/common/referrer.h" |
25 #include "ui/base/page_transition_types.h" | 25 #include "ui/base/page_transition_types.h" |
26 #include "url/origin.h" | 26 #include "url/origin.h" |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 class BrowserContext; | 29 class BrowserContext; |
30 class CrossProcessFrameConnector; | 30 class CrossProcessFrameConnector; |
31 class CrossSiteTransferringRequest; | |
32 class FrameNavigationEntry; | 31 class FrameNavigationEntry; |
33 class FrameTreeNode; | 32 class FrameTreeNode; |
34 class InterstitialPageImpl; | 33 class InterstitialPageImpl; |
35 class NavigationControllerImpl; | 34 class NavigationControllerImpl; |
36 class NavigationEntry; | 35 class NavigationEntry; |
37 class NavigationEntryImpl; | 36 class NavigationEntryImpl; |
38 class NavigationHandleImpl; | 37 class NavigationHandleImpl; |
39 class NavigationRequest; | 38 class NavigationRequest; |
40 class NavigatorTestWithBrowserSideNavigation; | 39 class NavigatorTestWithBrowserSideNavigation; |
41 class RenderFrameHostDelegate; | 40 class RenderFrameHostDelegate; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // by the first parameter) to allow the appropriate renderer to approve or | 291 // by the first parameter) to allow the appropriate renderer to approve or |
293 // deny the request. |proceed| indicates whether the user chose to proceed. | 292 // deny the request. |proceed| indicates whether the user chose to proceed. |
294 // |proceed_time| is the time when the request was allowed to proceed. | 293 // |proceed_time| is the time when the request was allowed to proceed. |
295 void OnBeforeUnloadACK(bool for_cross_site_transition, | 294 void OnBeforeUnloadACK(bool for_cross_site_transition, |
296 bool proceed, | 295 bool proceed, |
297 const base::TimeTicks& proceed_time); | 296 const base::TimeTicks& proceed_time); |
298 | 297 |
299 // The |pending_render_frame_host| is ready to commit a page. We should | 298 // The |pending_render_frame_host| is ready to commit a page. We should |
300 // ensure that the old RenderFrameHost runs its unload handler first and | 299 // ensure that the old RenderFrameHost runs its unload handler first and |
301 // determine whether a RenderFrameHost transfer is needed. | 300 // determine whether a RenderFrameHost transfer is needed. |
302 // |cross_site_transferring_request| is NULL if a request is not being | |
303 // transferred between renderers. | |
304 void OnCrossSiteResponse(RenderFrameHostImpl* pending_render_frame_host, | 301 void OnCrossSiteResponse(RenderFrameHostImpl* pending_render_frame_host, |
305 const GlobalRequestID& global_request_id, | 302 const GlobalRequestID& global_request_id, |
306 std::unique_ptr<CrossSiteTransferringRequest> | |
307 cross_site_transferring_request, | |
308 const std::vector<GURL>& transfer_url_chain, | 303 const std::vector<GURL>& transfer_url_chain, |
309 const Referrer& referrer, | 304 const Referrer& referrer, |
310 ui::PageTransition page_transition, | 305 ui::PageTransition page_transition, |
311 bool should_replace_current_entry); | 306 bool should_replace_current_entry); |
312 | 307 |
313 // Determines whether a navigation to |dest_url| may be completed using an | 308 // Determines whether a navigation to |dest_url| may be completed using an |
314 // existing RenderFrameHost, or whether transferring to a new RenderFrameHost | 309 // existing RenderFrameHost, or whether transferring to a new RenderFrameHost |
315 // backed by a different render process is required. This is a security policy | 310 // backed by a different render process is required. This is a security policy |
316 // check determined by the current site isolation mode, and must be done | 311 // check determined by the current site isolation mode, and must be done |
317 // before the resource at |dest_url| is delivered to |existing_rfh|. | 312 // before the resource at |dest_url| is delivered to |existing_rfh|. |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 // RenderFrame instance. | 765 // RenderFrame instance. |
771 // For now, RenderFrameHost keeps a RenderViewHost in its SiteInstance alive. | 766 // For now, RenderFrameHost keeps a RenderViewHost in its SiteInstance alive. |
772 // Eventually, RenderViewHost will be replaced with a page context. | 767 // Eventually, RenderViewHost will be replaced with a page context. |
773 std::unique_ptr<RenderFrameHostImpl> render_frame_host_; | 768 std::unique_ptr<RenderFrameHostImpl> render_frame_host_; |
774 | 769 |
775 // A RenderFrameHost used to load a cross-site page. This remains hidden | 770 // A RenderFrameHost used to load a cross-site page. This remains hidden |
776 // while a cross-site request is pending until it calls DidNavigate. | 771 // while a cross-site request is pending until it calls DidNavigate. |
777 // Note: This member is not used in PlzNavigate. | 772 // Note: This member is not used in PlzNavigate. |
778 std::unique_ptr<RenderFrameHostImpl> pending_render_frame_host_; | 773 std::unique_ptr<RenderFrameHostImpl> pending_render_frame_host_; |
779 | 774 |
780 // If a pending request needs to be transferred to another process, this | |
781 // owns the request until it's transferred to the new process, so it will be | |
782 // cleaned up if the navigation is cancelled. Otherwise, this is NULL. | |
783 std::unique_ptr<CrossSiteTransferringRequest> | |
784 cross_site_transferring_request_; | |
785 | |
786 // This is used to temporarily store the NavigationHandle during | 775 // This is used to temporarily store the NavigationHandle during |
787 // transferring navigations. The handle needs to be stored because the old | 776 // transferring navigations. The handle needs to be stored because the old |
788 // RenderFrameHost may be discarded before a new RenderFrameHost is created | 777 // RenderFrameHost may be discarded before a new RenderFrameHost is created |
789 // for the navigation. | 778 // for the navigation. |
790 // PlzNavigate: this will never be set since there are no transferring | 779 // PlzNavigate: this will never be set since there are no transferring |
791 // navigations in PlzNavigate. | 780 // navigations in PlzNavigate. |
792 std::unique_ptr<NavigationHandleImpl> transfer_navigation_handle_; | 781 std::unique_ptr<NavigationHandleImpl> transfer_navigation_handle_; |
793 | 782 |
794 // Proxy hosts, indexed by site instance ID. | 783 // Proxy hosts, indexed by site instance ID. |
795 std::unordered_map<int32_t, std::unique_ptr<RenderFrameProxyHost>> | 784 std::unordered_map<int32_t, std::unique_ptr<RenderFrameProxyHost>> |
(...skipping 19 matching lines...) Expand all Loading... |
815 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; | 804 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; |
816 | 805 |
817 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 806 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
818 | 807 |
819 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 808 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
820 }; | 809 }; |
821 | 810 |
822 } // namespace content | 811 } // namespace content |
823 | 812 |
824 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 813 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |