| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 // Runs the unload handler in the current page, when we know that a pending | 269 // Runs the unload handler in the current page, when we know that a pending |
| 270 // cross-process navigation is going to commit. We may initiate a transfer | 270 // cross-process navigation is going to commit. We may initiate a transfer |
| 271 // to a new process after this completes or times out. | 271 // to a new process after this completes or times out. |
| 272 void SwapOutOldPage(); | 272 void SwapOutOldPage(); |
| 273 | 273 |
| 274 // Deletes a RenderFrameHost that was pending shutdown. | 274 // Deletes a RenderFrameHost that was pending shutdown. |
| 275 void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id, | 275 void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id, |
| 276 RenderFrameHostImpl* rfh); | 276 RenderFrameHostImpl* rfh); |
| 277 | 277 |
| 278 // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown |
| 279 // frames when all the frames in a SiteInstance are confirmed to be swapped |
| 280 // out. |
| 281 static void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); |
| 282 |
| 278 private: | 283 private: |
| 279 friend class RenderFrameHostManagerTest; | 284 friend class RenderFrameHostManagerTest; |
| 280 friend class TestWebContents; | 285 friend class TestWebContents; |
| 281 | 286 |
| 282 // Tracks information about a navigation while a cross-process transition is | 287 // Tracks information about a navigation while a cross-process transition is |
| 283 // in progress, in case we need to transfer it to a new RenderFrameHost. | 288 // in progress, in case we need to transfer it to a new RenderFrameHost. |
| 284 // When a request is being transferred, deleting the PendingNavigationParams, | 289 // When a request is being transferred, deleting the PendingNavigationParams, |
| 285 // and thus |cross_site_transferring_request|, will cancel the request being | 290 // and thus |cross_site_transferring_request|, will cancel the request being |
| 286 // transferred, unless its ReleaseRequest method has been called. | 291 // transferred, unless its ReleaseRequest method has been called. |
| 287 struct PendingNavigationParams { | 292 struct PendingNavigationParams { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 // initialized for another RenderFrameHost. | 376 // initialized for another RenderFrameHost. |
| 372 // TODO(creis): opener_route_id is currently for the RenderViewHost but should | 377 // TODO(creis): opener_route_id is currently for the RenderViewHost but should |
| 373 // be for the RenderFrame, since frames can have openers. | 378 // be for the RenderFrame, since frames can have openers. |
| 374 bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id); | 379 bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id); |
| 375 | 380 |
| 376 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this | 381 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this |
| 377 // doesn't require the pending render_frame_host_ pointer to be non-NULL, | 382 // doesn't require the pending render_frame_host_ pointer to be non-NULL, |
| 378 // since there could be Web UI switching as well. Call this for every commit. | 383 // since there could be Web UI switching as well. Call this for every commit. |
| 379 void CommitPending(); | 384 void CommitPending(); |
| 380 | 385 |
| 381 // Shutdown all RenderFrameHosts in a SiteInstance. This is called to shutdown | |
| 382 // frames when all the frames in a SiteInstance are confirmed to be swapped | |
| 383 // out. | |
| 384 void ShutdownRenderFrameHostsInSiteInstance(int32 site_instance_id); | |
| 385 | |
| 386 // Helper method to terminate the pending RenderViewHost. | 386 // Helper method to terminate the pending RenderViewHost. |
| 387 void CancelPending(); | 387 void CancelPending(); |
| 388 | 388 |
| 389 RenderFrameHostImpl* UpdateRendererStateForNavigate( | 389 RenderFrameHostImpl* UpdateRendererStateForNavigate( |
| 390 const NavigationEntryImpl& entry); | 390 const NavigationEntryImpl& entry); |
| 391 | 391 |
| 392 // Called when a renderer process is starting to close. We should not | 392 // Called when a renderer process is starting to close. We should not |
| 393 // schedule new navigations in its swapped out RenderFrameHosts after this. | 393 // schedule new navigations in its swapped out RenderFrameHosts after this. |
| 394 void RendererProcessClosing(RenderProcessHost* render_process_host); | 394 void RendererProcessClosing(RenderProcessHost* render_process_host); |
| 395 | 395 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 CrossProcessFrameConnector* cross_process_frame_connector_; | 464 CrossProcessFrameConnector* cross_process_frame_connector_; |
| 465 | 465 |
| 466 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 466 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 467 | 467 |
| 468 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 468 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 469 }; | 469 }; |
| 470 | 470 |
| 471 } // namespace content | 471 } // namespace content |
| 472 | 472 |
| 473 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 473 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |