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" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 class RenderFrameHost; | 35 class RenderFrameHost; |
| 36 class RenderFrameHostImpl; | 36 class RenderFrameHostImpl; |
| 37 class RenderFrameHostManagerTest; | 37 class RenderFrameHostManagerTest; |
| 38 class RenderFrameProxyHost; | 38 class RenderFrameProxyHost; |
| 39 class RenderViewHost; | 39 class RenderViewHost; |
| 40 class RenderViewHostImpl; | 40 class RenderViewHostImpl; |
| 41 class RenderWidgetHostDelegate; | 41 class RenderWidgetHostDelegate; |
| 42 class RenderWidgetHostView; | 42 class RenderWidgetHostView; |
| 43 class TestWebContents; | 43 class TestWebContents; |
| 44 class WebUIImpl; | 44 class WebUIImpl; |
| 45 struct CommitNavigationParams; | |
| 46 struct CoreNavigationParams; | |
| 45 struct NavigationBeforeCommitInfo; | 47 struct NavigationBeforeCommitInfo; |
| 48 struct RequestNavigationParams; | |
| 46 | 49 |
| 47 // Manages RenderFrameHosts for a FrameTreeNode. This class acts as a state | 50 // Manages RenderFrameHosts for a FrameTreeNode. This class acts as a state |
| 48 // machine to make cross-process navigations in a frame possible. | 51 // machine to make cross-process navigations in a frame possible. |
| 49 class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { | 52 class CONTENT_EXPORT RenderFrameHostManager : public NotificationObserver { |
| 50 public: | 53 public: |
| 51 // Functions implemented by our owner that we need. | 54 // Functions implemented by our owner that we need. |
| 52 // | 55 // |
| 53 // TODO(brettw) Clean this up! These are all the functions in WebContentsImpl | 56 // TODO(brettw) Clean this up! These are all the functions in WebContentsImpl |
| 54 // that are required to run this class. The design should probably be better | 57 // that are required to run this class. The design should probably be better |
| 55 // such that these are more clear. | 58 // such that these are more clear. |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 // of WebContentsImpl. | 311 // of WebContentsImpl. |
| 309 void ResetProxyHosts(); | 312 void ResetProxyHosts(); |
| 310 | 313 |
| 311 // Returns the routing id for a RenderFrameHost or RenderFrameHostProxy | 314 // Returns the routing id for a RenderFrameHost or RenderFrameHostProxy |
| 312 // that has the given SiteInstance and is associated with this | 315 // that has the given SiteInstance and is associated with this |
| 313 // RenderFrameHostManager. Returns MSG_ROUTING_NONE if none is found. | 316 // RenderFrameHostManager. Returns MSG_ROUTING_NONE if none is found. |
| 314 int GetRoutingIdForSiteInstance(SiteInstance* site_instance); | 317 int GetRoutingIdForSiteInstance(SiteInstance* site_instance); |
| 315 | 318 |
| 316 // PlzNavigate: sends a RequestNavigation IPC to the renderer to ask it to | 319 // PlzNavigate: sends a RequestNavigation IPC to the renderer to ask it to |
| 317 // navigate. If no live renderer is present, then the navigation request will | 320 // navigate. If no live renderer is present, then the navigation request will |
| 318 // be sent directly to the ResourceDispatcherHost. | 321 // be sent directly to the ResourceDispatcherHost. Takes ownership of |
| 319 bool RequestNavigation(const NavigationEntryImpl& entry, | 322 // |core_params| and |commit_params| to send them to the appropriate renderer |
| 320 const FrameMsg_Navigate_Params& navigate_params); | 323 // when the navigation is ready to commit. |
| 324 bool RequestNavigation(scoped_ptr<CoreNavigationParams> core_params, | |
| 325 const RequestNavigationParams& request_params, | |
| 326 scoped_ptr<CommitNavigationParams> commit_params); | |
| 321 | 327 |
| 322 // PlzNavigate: Used to start a navigation. OnBeginNavigation is called | 328 // PlzNavigate: Used to start a navigation. OnBeginNavigation is called |
| 323 // directly by RequestNavigation when there is no live renderer. Otherwise, it | 329 // directly by RequestNavigation when there is no live renderer. Otherwise, it |
| 324 // is called following a BeginNavigation IPC from the renderer (which in | 330 // is called following a BeginNavigation IPC from the renderer (which in |
| 325 // browser-initiated navigation also happens after RequestNavigation has been | 331 // browser-initiated navigation also happens after RequestNavigation has been |
| 326 // called). | 332 // called). |
| 327 void OnBeginNavigation(const FrameHostMsg_BeginNavigation_Params& params); | 333 void OnBeginNavigation(const FrameHostMsg_BeginNavigation_Params& params, |
| 334 const CoreNavigationParams& core_params); | |
| 328 | 335 |
| 329 // PlzNavigate: Called when a navigation request has received a response, to | 336 // PlzNavigate: Called when a navigation request has received a response, to |
| 330 // select a renderer to use for the navigation. | 337 // select a renderer to use for the navigation. |
| 331 void CommitNavigation(const NavigationBeforeCommitInfo& info); | 338 void CommitNavigation(const NavigationBeforeCommitInfo& info); |
| 332 | 339 |
| 333 private: | 340 private: |
| 334 friend class RenderFrameHostManagerTest; | 341 friend class RenderFrameHostManagerTest; |
| 335 friend class TestWebContents; | 342 friend class TestWebContents; |
| 336 | 343 |
| 337 FRIEND_TEST_ALL_PREFIXES(CrossProcessFrameTreeBrowserTest, | 344 FRIEND_TEST_ALL_PREFIXES(CrossProcessFrameTreeBrowserTest, |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 528 // The intersitial page currently shown if any, not own by this class | 535 // The intersitial page currently shown if any, not own by this class |
| 529 // (the InterstitialPage is self-owned, it deletes itself when hidden). | 536 // (the InterstitialPage is self-owned, it deletes itself when hidden). |
| 530 InterstitialPageImpl* interstitial_page_; | 537 InterstitialPageImpl* interstitial_page_; |
| 531 | 538 |
| 532 NotificationRegistrar registrar_; | 539 NotificationRegistrar registrar_; |
| 533 | 540 |
| 534 // PlzNavigate: Owns a navigation request that originated in that frame until | 541 // PlzNavigate: Owns a navigation request that originated in that frame until |
| 535 // it commits. | 542 // it commits. |
| 536 scoped_ptr<NavigationRequest> navigation_request_; | 543 scoped_ptr<NavigationRequest> navigation_request_; |
| 537 | 544 |
| 545 // PlzNavigate: Holds info that should be sent to the renderer when the | |
|
Charlie Reis
2014/09/19 23:12:31
Do these have the same lifetime as navigation_requ
clamy
2014/09/23 21:13:25
I moved them inside navigation_request_. They did
| |
| 546 // navigation is about to commit. | |
| 547 scoped_ptr<CoreNavigationParams> core_navigation_params_; | |
| 548 scoped_ptr<CommitNavigationParams> commit_navigation_params_; | |
|
Charlie Reis
2014/09/19 23:12:31
(I'm still a bit nervous about storing request-spe
clamy
2014/09/23 21:13:25
I think storing them in the NavigationRequest make
| |
| 549 | |
| 538 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 550 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 539 | 551 |
| 540 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 552 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 541 }; | 553 }; |
| 542 | 554 |
| 543 } // namespace content | 555 } // namespace content |
| 544 | 556 |
| 545 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 557 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |