Chromium Code Reviews| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/browser/renderer_host/render_view_host_delegate.h" | 12 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 13 #include "content/browser/site_instance_impl.h" | 13 #include "content/browser/site_instance_impl.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/public/browser/global_request_id.h" | 15 #include "content/public/browser/global_request_id.h" |
| 16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/common/referrer.h" | 18 #include "content/public/common/referrer.h" |
| 19 | 19 |
| 20 struct FrameHostMsg_BeginNavigation_Params; | |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 class BrowserContext; | 23 class BrowserContext; |
| 23 class CrossProcessFrameConnector; | 24 class CrossProcessFrameConnector; |
| 24 class CrossSiteTransferringRequest; | 25 class CrossSiteTransferringRequest; |
| 25 class InterstitialPageImpl; | 26 class InterstitialPageImpl; |
| 26 class FrameTreeNode; | 27 class FrameTreeNode; |
| 27 class NavigationControllerImpl; | 28 class NavigationControllerImpl; |
| 28 class NavigationEntry; | 29 class NavigationEntry; |
| 29 class NavigationEntryImpl; | 30 class NavigationEntryImpl; |
| 31 class NavigationRequest; | |
| 30 class RenderFrameHost; | 32 class RenderFrameHost; |
| 31 class RenderFrameHostDelegate; | 33 class RenderFrameHostDelegate; |
| 32 class RenderFrameHostImpl; | 34 class RenderFrameHostImpl; |
| 33 class RenderFrameHostManagerTest; | 35 class RenderFrameHostManagerTest; |
| 34 class RenderFrameProxyHost; | 36 class RenderFrameProxyHost; |
| 35 class RenderViewHost; | 37 class RenderViewHost; |
| 36 class RenderViewHostImpl; | 38 class RenderViewHostImpl; |
| 37 class RenderWidgetHostDelegate; | 39 class RenderWidgetHostDelegate; |
| 38 class RenderWidgetHostView; | 40 class RenderWidgetHostView; |
| 39 class TestWebContents; | 41 class TestWebContents; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 void SwapOutOldPage(); | 295 void SwapOutOldPage(); |
| 294 | 296 |
| 295 // Deletes a RenderFrameHost that was pending shutdown. | 297 // Deletes a RenderFrameHost that was pending shutdown. |
| 296 void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id, | 298 void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id, |
| 297 RenderFrameHostImpl* rfh); | 299 RenderFrameHostImpl* rfh); |
| 298 | 300 |
| 299 // Deletes any proxy hosts associated with this node. Used during destruction | 301 // Deletes any proxy hosts associated with this node. Used during destruction |
| 300 // of WebContentsImpl. | 302 // of WebContentsImpl. |
| 301 void ResetProxyHosts(); | 303 void ResetProxyHosts(); |
| 302 | 304 |
| 305 // Used to start a navigation, part of PlzNavigate project. | |
| 306 void BeginNavigation(const FrameHostMsg_BeginNavigation_Params& params); | |
|
ppi
2014/07/10 16:03:34
We might want to call it transitively: OnBeginNavi
clamy
2014/07/15 15:32:14
Done.
| |
| 307 | |
| 303 private: | 308 private: |
| 304 friend class RenderFrameHostManagerTest; | 309 friend class RenderFrameHostManagerTest; |
| 305 friend class TestWebContents; | 310 friend class TestWebContents; |
| 306 | 311 |
| 307 // Tracks information about a navigation while a cross-process transition is | 312 // Tracks information about a navigation while a cross-process transition is |
| 308 // in progress, in case we need to transfer it to a new RenderFrameHost. | 313 // in progress, in case we need to transfer it to a new RenderFrameHost. |
| 309 // When a request is being transferred, deleting the PendingNavigationParams, | 314 // When a request is being transferred, deleting the PendingNavigationParams, |
| 310 // and thus |cross_site_transferring_request|, will cancel the request being | 315 // and thus |cross_site_transferring_request|, will cancel the request being |
| 311 // transferred, unless its ReleaseRequest method has been called. | 316 // transferred, unless its ReleaseRequest method has been called. |
| 312 struct PendingNavigationParams { | 317 struct PendingNavigationParams { |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 342 // This is the transition type for the original navigation. | 347 // This is the transition type for the original navigation. |
| 343 PageTransition page_transition; | 348 PageTransition page_transition; |
| 344 | 349 |
| 345 // This is the frame routing ID to use in RequestTransferURL. | 350 // This is the frame routing ID to use in RequestTransferURL. |
| 346 int render_frame_id; | 351 int render_frame_id; |
| 347 | 352 |
| 348 // This is whether the navigation should replace the current history entry. | 353 // This is whether the navigation should replace the current history entry. |
| 349 bool should_replace_current_entry; | 354 bool should_replace_current_entry; |
| 350 }; | 355 }; |
| 351 | 356 |
| 357 // Returns the current navigation request (used in the PlzNavigate navigation | |
| 358 // logic refactoring project). | |
| 359 NavigationRequest* navigation_request_for_testing() const { | |
| 360 return navigation_request_.get(); } | |
| 361 | |
| 352 // Used with FrameTree::ForEach to erase RenderFrameProxyHosts from a | 362 // Used with FrameTree::ForEach to erase RenderFrameProxyHosts from a |
| 353 // FrameTreeNode's RenderFrameHostManager. | 363 // FrameTreeNode's RenderFrameHostManager. |
| 354 static bool ClearProxiesInSiteInstance(int32 site_instance_id, | 364 static bool ClearProxiesInSiteInstance(int32 site_instance_id, |
| 355 FrameTreeNode* node); | 365 FrameTreeNode* node); |
| 356 | 366 |
| 357 // Returns whether this tab should transition to a new renderer for | 367 // Returns whether this tab should transition to a new renderer for |
| 358 // cross-site URLs. Enabled unless we see the --process-per-tab command line | 368 // cross-site URLs. Enabled unless we see the --process-per-tab command line |
| 359 // switch. Can be overridden in unit tests. | 369 // switch. Can be overridden in unit tests. |
| 360 bool ShouldTransitionCrossSite(); | 370 bool ShouldTransitionCrossSite(); |
| 361 | 371 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 487 typedef base::hash_map<int32, linked_ptr<RenderFrameHostImpl> > | 497 typedef base::hash_map<int32, linked_ptr<RenderFrameHostImpl> > |
| 488 RFHPendingDeleteMap; | 498 RFHPendingDeleteMap; |
| 489 RFHPendingDeleteMap pending_delete_hosts_; | 499 RFHPendingDeleteMap pending_delete_hosts_; |
| 490 | 500 |
| 491 // The intersitial page currently shown if any, not own by this class | 501 // The intersitial page currently shown if any, not own by this class |
| 492 // (the InterstitialPage is self-owned, it deletes itself when hidden). | 502 // (the InterstitialPage is self-owned, it deletes itself when hidden). |
| 493 InterstitialPageImpl* interstitial_page_; | 503 InterstitialPageImpl* interstitial_page_; |
| 494 | 504 |
| 495 NotificationRegistrar registrar_; | 505 NotificationRegistrar registrar_; |
| 496 | 506 |
| 507 // Owns a navigation request that originated in that frame until it commits. | |
| 508 scoped_ptr<NavigationRequest> navigation_request_; | |
| 509 | |
| 497 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 510 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 498 | 511 |
| 499 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 512 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 500 }; | 513 }; |
| 501 | 514 |
| 502 } // namespace content | 515 } // namespace content |
| 503 | 516 |
| 504 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 517 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |