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> |
11 #include <map> | 11 #include <map> |
12 #include <memory> | 12 #include <memory> |
13 #include <unordered_map> | 13 #include <unordered_map> |
14 | 14 |
15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" |
18 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
19 #include "content/browser/frame_host/render_frame_host_impl.h" | 20 #include "content/browser/frame_host/render_frame_host_impl.h" |
20 #include "content/browser/renderer_host/render_view_host_delegate.h" | 21 #include "content/browser/renderer_host/render_view_host_delegate.h" |
21 #include "content/browser/site_instance_impl.h" | 22 #include "content/browser/site_instance_impl.h" |
22 #include "content/common/content_export.h" | 23 #include "content/common/content_export.h" |
23 #include "content/public/browser/global_request_id.h" | 24 #include "content/public/browser/global_request_id.h" |
24 #include "content/public/common/referrer.h" | 25 #include "content/public/common/referrer.h" |
25 #include "ui/base/page_transition_types.h" | 26 #include "ui/base/page_transition_types.h" |
26 #include "url/origin.h" | 27 #include "url/origin.h" |
27 | 28 |
(...skipping 10 matching lines...) Expand all Loading... |
38 class NavigationHandleImpl; | 39 class NavigationHandleImpl; |
39 class NavigationRequest; | 40 class NavigationRequest; |
40 class NavigatorTestWithBrowserSideNavigation; | 41 class NavigatorTestWithBrowserSideNavigation; |
41 class RenderFrameHostDelegate; | 42 class RenderFrameHostDelegate; |
42 class RenderFrameHostManagerTest; | 43 class RenderFrameHostManagerTest; |
43 class RenderFrameProxyHost; | 44 class RenderFrameProxyHost; |
44 class RenderViewHost; | 45 class RenderViewHost; |
45 class RenderViewHostImpl; | 46 class RenderViewHostImpl; |
46 class RenderWidgetHostDelegate; | 47 class RenderWidgetHostDelegate; |
47 class RenderWidgetHostView; | 48 class RenderWidgetHostView; |
| 49 class ResourceRequestBody; |
48 class TestWebContents; | 50 class TestWebContents; |
49 class WebUIImpl; | 51 class WebUIImpl; |
50 struct CommonNavigationParams; | 52 struct CommonNavigationParams; |
51 struct FrameReplicationState; | 53 struct FrameReplicationState; |
52 | 54 |
53 // Manages RenderFrameHosts for a FrameTreeNode. It maintains a | 55 // Manages RenderFrameHosts for a FrameTreeNode. It maintains a |
54 // current_frame_host() which is the content currently visible to the user. When | 56 // current_frame_host() which is the content currently visible to the user. When |
55 // a frame is told to navigate to a different web site (as determined by | 57 // a frame is told to navigate to a different web site (as determined by |
56 // SiteInstance), it will replace its current RenderFrameHost with a new | 58 // SiteInstance), it will replace its current RenderFrameHost with a new |
57 // RenderFrameHost dedicated to the new SiteInstance, possibly in a new process. | 59 // RenderFrameHost dedicated to the new SiteInstance, possibly in a new process. |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // |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. |
292 void OnBeforeUnloadACK(bool for_cross_site_transition, | 294 void OnBeforeUnloadACK(bool for_cross_site_transition, |
293 bool proceed, | 295 bool proceed, |
294 const base::TimeTicks& proceed_time); | 296 const base::TimeTicks& proceed_time); |
295 | 297 |
296 // 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 |
297 // ensure that the old RenderFrameHost runs its unload handler first and | 299 // ensure that the old RenderFrameHost runs its unload handler first and |
298 // determine whether a RenderFrameHost transfer is needed. | 300 // determine whether a RenderFrameHost transfer is needed. |
299 // |cross_site_transferring_request| is NULL if a request is not being | 301 // |cross_site_transferring_request| is NULL if a request is not being |
300 // transferred between renderers. | 302 // transferred between renderers. |
301 void OnCrossSiteResponse(RenderFrameHostImpl* pending_render_frame_host, | 303 void OnCrossSiteResponse( |
302 const GlobalRequestID& global_request_id, | 304 RenderFrameHostImpl* pending_render_frame_host, |
303 std::unique_ptr<CrossSiteTransferringRequest> | 305 const GlobalRequestID& global_request_id, |
304 cross_site_transferring_request, | 306 std::unique_ptr<CrossSiteTransferringRequest> |
305 const std::vector<GURL>& transfer_url_chain, | 307 cross_site_transferring_request, |
306 const Referrer& referrer, | 308 const std::vector<GURL>& transfer_url_chain, |
307 ui::PageTransition page_transition, | 309 const Referrer& referrer, |
308 bool should_replace_current_entry); | 310 ui::PageTransition page_transition, |
| 311 bool should_replace_current_entry, |
| 312 const scoped_refptr<ResourceRequestBody>& resource_request_body); |
309 | 313 |
310 // Determines whether a navigation to |dest_url| may be completed using an | 314 // Determines whether a navigation to |dest_url| may be completed using an |
311 // existing RenderFrameHost, or whether transferring to a new RenderFrameHost | 315 // existing RenderFrameHost, or whether transferring to a new RenderFrameHost |
312 // backed by a different render process is required. This is a security policy | 316 // backed by a different render process is required. This is a security policy |
313 // check determined by the current site isolation mode, and must be done | 317 // check determined by the current site isolation mode, and must be done |
314 // before the resource at |dest_url| is delivered to |existing_rfh|. | 318 // before the resource at |dest_url| is delivered to |existing_rfh|. |
315 // | 319 // |
316 // |existing_rfh| must belong to this RFHM, but it can be a pending or current | 320 // |existing_rfh| must belong to this RFHM, but it can be a pending or current |
317 // host. | 321 // host. |
318 // | 322 // |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; | 796 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; |
793 | 797 |
794 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 798 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
795 | 799 |
796 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 800 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
797 }; | 801 }; |
798 | 802 |
799 } // namespace content | 803 } // namespace content |
800 | 804 |
801 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 805 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |