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 10 matching lines...) Expand all Loading... | |
| 21 namespace content { | 21 namespace content { |
| 22 class BrowserContext; | 22 class BrowserContext; |
| 23 class CrossProcessFrameConnector; | 23 class CrossProcessFrameConnector; |
| 24 class CrossSiteTransferringRequest; | 24 class CrossSiteTransferringRequest; |
| 25 class InterstitialPageImpl; | 25 class InterstitialPageImpl; |
| 26 class FrameTreeNode; | 26 class FrameTreeNode; |
| 27 class NavigationControllerImpl; | 27 class NavigationControllerImpl; |
| 28 class NavigationEntry; | 28 class NavigationEntry; |
| 29 class NavigationEntryImpl; | 29 class NavigationEntryImpl; |
| 30 class RenderFrameHostDelegate; | 30 class RenderFrameHostDelegate; |
| 31 class RenderFrameHost; | |
| 31 class RenderFrameHostImpl; | 32 class RenderFrameHostImpl; |
| 32 class RenderFrameHostManagerTest; | 33 class RenderFrameHostManagerTest; |
| 33 class RenderFrameProxyHost; | 34 class RenderFrameProxyHost; |
| 34 class RenderViewHost; | 35 class RenderViewHost; |
| 35 class RenderViewHostImpl; | 36 class RenderViewHostImpl; |
| 36 class RenderWidgetHostDelegate; | 37 class RenderWidgetHostDelegate; |
| 37 class RenderWidgetHostView; | 38 class RenderWidgetHostView; |
| 38 class TestWebContents; | 39 class TestWebContents; |
| 39 class WebUIImpl; | 40 class WebUIImpl; |
| 40 | 41 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 58 // process is not shared, then the WebContentsImpl will act as though the | 59 // process is not shared, then the WebContentsImpl will act as though the |
| 59 // renderer is not running (i.e., it will render "sad tab"). This method is | 60 // renderer is not running (i.e., it will render "sad tab"). This method is |
| 60 // automatically called from LoadURL. |for_main_frame| indicates whether | 61 // automatically called from LoadURL. |for_main_frame| indicates whether |
| 61 // this RenderViewHost is used to render a top-level frame, so the | 62 // this RenderViewHost is used to render a top-level frame, so the |
| 62 // appropriate RenderWidgetHostView type is used. | 63 // appropriate RenderWidgetHostView type is used. |
| 63 virtual bool CreateRenderViewForRenderManager( | 64 virtual bool CreateRenderViewForRenderManager( |
| 64 RenderViewHost* render_view_host, | 65 RenderViewHost* render_view_host, |
| 65 int opener_route_id, | 66 int opener_route_id, |
| 66 int proxy_routing_id, | 67 int proxy_routing_id, |
| 67 bool for_main_frame) = 0; | 68 bool for_main_frame) = 0; |
| 69 virtual bool CreateRenderFrameForRenderManager( | |
| 70 RenderFrameHost* render_frame_host, | |
| 71 int parent_routing_id) = 0; | |
| 68 virtual void BeforeUnloadFiredFromRenderManager( | 72 virtual void BeforeUnloadFiredFromRenderManager( |
| 69 bool proceed, const base::TimeTicks& proceed_time, | 73 bool proceed, const base::TimeTicks& proceed_time, |
| 70 bool* proceed_to_fire_unload) = 0; | 74 bool* proceed_to_fire_unload) = 0; |
| 71 virtual void RenderProcessGoneFromRenderManager( | 75 virtual void RenderProcessGoneFromRenderManager( |
| 72 RenderViewHost* render_view_host) = 0; | 76 RenderViewHost* render_view_host) = 0; |
| 73 virtual void UpdateRenderViewSizeForRenderManager() = 0; | 77 virtual void UpdateRenderViewSizeForRenderManager() = 0; |
| 74 virtual void CancelModalDialogsForRenderManager() = 0; | 78 virtual void CancelModalDialogsForRenderManager() = 0; |
| 75 virtual void NotifySwappedFromRenderManager( | 79 virtual void NotifySwappedFromRenderManager( |
| 76 RenderViewHost* old_host, RenderViewHost* new_host) = 0; | 80 RenderViewHost* old_host, RenderViewHost* new_host) = 0; |
| 77 virtual NavigationControllerImpl& | 81 virtual NavigationControllerImpl& |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 | 246 |
| 243 // Helper method to create and initialize a RenderFrameHost. If |swapped_out| | 247 // Helper method to create and initialize a RenderFrameHost. If |swapped_out| |
| 244 // is true, it will be initially placed on the swapped out hosts list. | 248 // is true, it will be initially placed on the swapped out hosts list. |
| 245 // Otherwise, it will be used for a pending cross-site navigation. | 249 // Otherwise, it will be used for a pending cross-site navigation. |
| 246 // Returns the routing id of the *view* associated with the frame. | 250 // Returns the routing id of the *view* associated with the frame. |
| 247 int CreateRenderFrame(SiteInstance* instance, | 251 int CreateRenderFrame(SiteInstance* instance, |
| 248 int opener_route_id, | 252 int opener_route_id, |
| 249 bool swapped_out, | 253 bool swapped_out, |
| 250 bool hidden); | 254 bool hidden); |
| 251 | 255 |
| 256 // Helper method to create and initialize a RenderFrameProxyHost. | |
| 257 int CreateRenderFrameProxy(SiteInstance* instance, int opener_route_id); | |
| 258 | |
| 252 // Sets the passed passed interstitial as the currently showing interstitial. | 259 // Sets the passed passed interstitial as the currently showing interstitial. |
| 253 // |interstitial_page| should be non NULL (use the remove_interstitial_page | 260 // |interstitial_page| should be non NULL (use the remove_interstitial_page |
| 254 // method to unset the interstitial) and no interstitial page should be set | 261 // method to unset the interstitial) and no interstitial page should be set |
| 255 // when there is already a non NULL interstitial page set. | 262 // when there is already a non NULL interstitial page set. |
| 256 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { | 263 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { |
| 257 DCHECK(!interstitial_page_ && interstitial_page); | 264 DCHECK(!interstitial_page_ && interstitial_page); |
| 258 interstitial_page_ = interstitial_page; | 265 interstitial_page_ = interstitial_page; |
| 259 } | 266 } |
| 260 | 267 |
| 261 // Unsets the currently showing interstitial. | 268 // Unsets the currently showing interstitial. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 291 void SwapOutOldPage(); | 298 void SwapOutOldPage(); |
| 292 | 299 |
| 293 // Deletes a RenderFrameHost that was pending shutdown. | 300 // Deletes a RenderFrameHost that was pending shutdown. |
| 294 void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id, | 301 void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id, |
| 295 RenderFrameHostImpl* rfh); | 302 RenderFrameHostImpl* rfh); |
| 296 | 303 |
| 297 // Deletes any proxy hosts associated with this node. Used during destruction | 304 // Deletes any proxy hosts associated with this node. Used during destruction |
| 298 // of WebContentsImpl. | 305 // of WebContentsImpl. |
| 299 void ResetProxyHosts(); | 306 void ResetProxyHosts(); |
| 300 | 307 |
| 308 int GetRoutingIdForSiteInstance(SiteInstance* site_instance); | |
|
ncarter (slow)
2014/06/25 01:07:56
A great comment here would be one that indicates t
| |
| 309 | |
| 301 private: | 310 private: |
| 302 friend class RenderFrameHostManagerTest; | 311 friend class RenderFrameHostManagerTest; |
| 303 friend class TestWebContents; | 312 friend class TestWebContents; |
| 304 | 313 |
| 314 FRIEND_TEST_ALL_PREFIXES(CrossProcessFrameTreeBrowserTest, | |
| 315 VerifyProxyCreation); | |
| 316 | |
| 305 // Tracks information about a navigation while a cross-process transition is | 317 // Tracks information about a navigation while a cross-process transition is |
| 306 // in progress, in case we need to transfer it to a new RenderFrameHost. | 318 // in progress, in case we need to transfer it to a new RenderFrameHost. |
| 307 // When a request is being transferred, deleting the PendingNavigationParams, | 319 // When a request is being transferred, deleting the PendingNavigationParams, |
| 308 // and thus |cross_site_transferring_request|, will cancel the request being | 320 // and thus |cross_site_transferring_request|, will cancel the request being |
| 309 // transferred, unless its ReleaseRequest method has been called. | 321 // transferred, unless its ReleaseRequest method has been called. |
| 310 struct PendingNavigationParams { | 322 struct PendingNavigationParams { |
| 311 PendingNavigationParams( | 323 PendingNavigationParams( |
| 312 const GlobalRequestID& global_request_id, | 324 const GlobalRequestID& global_request_id, |
| 313 scoped_ptr<CrossSiteTransferringRequest> | 325 scoped_ptr<CrossSiteTransferringRequest> |
| 314 cross_site_transferring_request, | 326 cross_site_transferring_request, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 // with the given |proxy_routing_id|, which is used to route IPC messages when | 406 // with the given |proxy_routing_id|, which is used to route IPC messages when |
| 395 // in swapped out state. Returns early if the RenderViewHost has already been | 407 // in swapped out state. Returns early if the RenderViewHost has already been |
| 396 // initialized for another RenderFrameHost. | 408 // initialized for another RenderFrameHost. |
| 397 // TODO(creis): opener_route_id is currently for the RenderViewHost but should | 409 // TODO(creis): opener_route_id is currently for the RenderViewHost but should |
| 398 // be for the RenderFrame, since frames can have openers. | 410 // be for the RenderFrame, since frames can have openers. |
| 399 bool InitRenderView(RenderViewHost* render_view_host, | 411 bool InitRenderView(RenderViewHost* render_view_host, |
| 400 int opener_route_id, | 412 int opener_route_id, |
| 401 int proxy_routing_id, | 413 int proxy_routing_id, |
| 402 bool for_main_frame); | 414 bool for_main_frame); |
| 403 | 415 |
| 416 bool InitRenderFrame(RenderFrameHost* render_frame_host); | |
| 417 | |
| 404 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this | 418 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this |
| 405 // doesn't require the pending render_frame_host_ pointer to be non-NULL, | 419 // doesn't require the pending render_frame_host_ pointer to be non-NULL, |
| 406 // since there could be Web UI switching as well. Call this for every commit. | 420 // since there could be Web UI switching as well. Call this for every commit. |
| 407 void CommitPending(); | 421 void CommitPending(); |
| 408 | 422 |
| 409 // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown | 423 // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown |
| 410 // frames when all the frames in a SiteInstance are confirmed to be swapped | 424 // frames when all the frames in a SiteInstance are confirmed to be swapped |
| 411 // out. | 425 // out. |
| 412 void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); | 426 void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); |
| 413 | 427 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 493 NotificationRegistrar registrar_; | 507 NotificationRegistrar registrar_; |
| 494 | 508 |
| 495 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 509 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 496 | 510 |
| 497 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 511 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 498 }; | 512 }; |
| 499 | 513 |
| 500 } // namespace content | 514 } // namespace content |
| 501 | 515 |
| 502 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 516 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |