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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 // RenderFrame instance. | 764 // RenderFrame instance. |
770 // For now, RenderFrameHost keeps a RenderViewHost in its SiteInstance alive. | 765 // For now, RenderFrameHost keeps a RenderViewHost in its SiteInstance alive. |
771 // Eventually, RenderViewHost will be replaced with a page context. | 766 // Eventually, RenderViewHost will be replaced with a page context. |
772 std::unique_ptr<RenderFrameHostImpl> render_frame_host_; | 767 std::unique_ptr<RenderFrameHostImpl> render_frame_host_; |
773 | 768 |
774 // A RenderFrameHost used to load a cross-site page. This remains hidden | 769 // A RenderFrameHost used to load a cross-site page. This remains hidden |
775 // while a cross-site request is pending until it calls DidNavigate. | 770 // while a cross-site request is pending until it calls DidNavigate. |
776 // Note: This member is not used in PlzNavigate. | 771 // Note: This member is not used in PlzNavigate. |
777 std::unique_ptr<RenderFrameHostImpl> pending_render_frame_host_; | 772 std::unique_ptr<RenderFrameHostImpl> pending_render_frame_host_; |
778 | 773 |
779 // If a pending request needs to be transferred to another process, this | |
780 // owns the request until it's transferred to the new process, so it will be | |
781 // cleaned up if the navigation is cancelled. Otherwise, this is NULL. | |
782 std::unique_ptr<CrossSiteTransferringRequest> | |
783 cross_site_transferring_request_; | |
784 | |
785 // This is used to temporarily store the NavigationHandle during | 774 // This is used to temporarily store the NavigationHandle during |
786 // transferring navigations. The handle needs to be stored because the old | 775 // transferring navigations. The handle needs to be stored because the old |
787 // RenderFrameHost may be discarded before a new RenderFrameHost is created | 776 // RenderFrameHost may be discarded before a new RenderFrameHost is created |
788 // for the navigation. | 777 // for the navigation. |
789 // PlzNavigate: this will never be set since there are no transferring | 778 // PlzNavigate: this will never be set since there are no transferring |
790 // navigations in PlzNavigate. | 779 // navigations in PlzNavigate. |
791 std::unique_ptr<NavigationHandleImpl> transfer_navigation_handle_; | 780 std::unique_ptr<NavigationHandleImpl> transfer_navigation_handle_; |
792 | 781 |
793 // Proxy hosts, indexed by site instance ID. | 782 // Proxy hosts, indexed by site instance ID. |
794 std::unordered_map<int32_t, std::unique_ptr<RenderFrameProxyHost>> | 783 std::unordered_map<int32_t, std::unique_ptr<RenderFrameProxyHost>> |
(...skipping 19 matching lines...) Expand all Loading... |
814 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; | 803 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; |
815 | 804 |
816 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 805 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
817 | 806 |
818 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 807 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
819 }; | 808 }; |
820 | 809 |
821 } // namespace content | 810 } // namespace content |
822 | 811 |
823 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 812 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |