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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 // transferred between renderers. | 211 // transferred between renderers. |
| 212 void OnCrossSiteResponse( | 212 void OnCrossSiteResponse( |
| 213 RenderFrameHostImpl* pending_render_frame_host, | 213 RenderFrameHostImpl* pending_render_frame_host, |
| 214 const GlobalRequestID& global_request_id, | 214 const GlobalRequestID& global_request_id, |
| 215 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request, | 215 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request, |
| 216 const std::vector<GURL>& transfer_url_chain, | 216 const std::vector<GURL>& transfer_url_chain, |
| 217 const Referrer& referrer, | 217 const Referrer& referrer, |
| 218 PageTransition page_transition, | 218 PageTransition page_transition, |
| 219 bool should_replace_current_entry); | 219 bool should_replace_current_entry); |
| 220 | 220 |
| 221 // Recieved a response from cross site resource handler. If | |
|
nasko
2014/05/28 22:59:00
nit: CrossSiteResourceHandler
Also, single "If" lo
shatch
2014/05/29 21:41:22
Done.
| |
| 222 void OnDeferredAfterResponseStarted( | |
| 223 const GlobalRequestID& global_request_id, | |
| 224 RenderFrameHostImpl* pending_render_frame_host); | |
| 225 | |
| 226 // Sets whether or not the navigation should pause on first response. | |
| 227 void SetHasPendingTransitionRequest( | |
| 228 bool has_pending_transition); | |
| 229 | |
| 221 // The RenderFrameHost has been swapped out, so we should resume the pending | 230 // The RenderFrameHost has been swapped out, so we should resume the pending |
| 222 // network response and allow the pending RenderFrameHost to commit. | 231 // network response and allow the pending RenderFrameHost to commit. |
| 223 void SwappedOut(RenderFrameHostImpl* render_frame_host); | 232 void SwappedOut(RenderFrameHostImpl* render_frame_host); |
| 224 | 233 |
| 234 // Resume navigation paused after receiving response headers. | |
| 235 void ResumeResponseDeferredAtStart(); | |
|
nasko
2014/05/28 22:59:00
nit: Move this definition up, so it is grouped tog
shatch
2014/05/29 21:41:22
Done.
| |
| 236 | |
| 225 // Called when a renderer's frame navigates. | 237 // Called when a renderer's frame navigates. |
| 226 void DidNavigateFrame(RenderFrameHostImpl* render_frame_host); | 238 void DidNavigateFrame(RenderFrameHostImpl* render_frame_host); |
| 227 | 239 |
| 228 // Called when a renderer sets its opener to null. | 240 // Called when a renderer sets its opener to null. |
| 229 void DidDisownOpener(RenderViewHost* render_view_host); | 241 void DidDisownOpener(RenderViewHost* render_view_host); |
| 230 | 242 |
| 231 // Helper method to create and initialize a RenderFrameHost. If |swapped_out| | 243 // Helper method to create and initialize a RenderFrameHost. If |swapped_out| |
| 232 // is true, it will be initially placed on the swapped out hosts list. | 244 // is true, it will be initially placed on the swapped out hosts list. |
| 233 // Otherwise, it will be used for a pending cross-site navigation. | 245 // Otherwise, it will be used for a pending cross-site navigation. |
| 234 int CreateRenderFrame(SiteInstance* instance, | 246 int CreateRenderFrame(SiteInstance* instance, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 // This is the transition type for the original navigation. | 335 // This is the transition type for the original navigation. |
| 324 PageTransition page_transition; | 336 PageTransition page_transition; |
| 325 | 337 |
| 326 // This is the frame routing ID to use in RequestTransferURL. | 338 // This is the frame routing ID to use in RequestTransferURL. |
| 327 int render_frame_id; | 339 int render_frame_id; |
| 328 | 340 |
| 329 // This is whether the navigation should replace the current history entry. | 341 // This is whether the navigation should replace the current history entry. |
| 330 bool should_replace_current_entry; | 342 bool should_replace_current_entry; |
| 331 }; | 343 }; |
| 332 | 344 |
| 345 // Tracks information about a navigation that's been paused after | |
| 346 // first response. | |
| 347 struct ResponseStartedParams { | |
|
nasko
2014/05/28 22:59:00
Do we really need a struct just to wrap a single s
shatch
2014/05/29 21:41:22
Changed the response_started_params_ to a scoped_p
| |
| 348 ResponseStartedParams( | |
| 349 const GlobalRequestID& global_request_id); | |
| 350 ~ResponseStartedParams(); | |
| 351 | |
| 352 // The child ID and request ID for the pending navigation. Present whether | |
| 353 // |request_transfer| is NULL or not. | |
| 354 GlobalRequestID global_request_id; | |
| 355 }; | |
| 356 | |
| 333 // Used with FrameTree::ForEach to erase RenderFrameProxyHosts from a | 357 // Used with FrameTree::ForEach to erase RenderFrameProxyHosts from a |
| 334 // FrameTreeNode's RenderFrameHostManager. | 358 // FrameTreeNode's RenderFrameHostManager. |
| 335 static bool ClearProxiesInSiteInstance(int32 site_instance_id, | 359 static bool ClearProxiesInSiteInstance(int32 site_instance_id, |
| 336 FrameTreeNode* node); | 360 FrameTreeNode* node); |
| 337 | 361 |
| 338 // Returns whether this tab should transition to a new renderer for | 362 // Returns whether this tab should transition to a new renderer for |
| 339 // cross-site URLs. Enabled unless we see the --process-per-tab command line | 363 // cross-site URLs. Enabled unless we see the --process-per-tab command line |
| 340 // switch. Can be overridden in unit tests. | 364 // switch. Can be overridden in unit tests. |
| 341 bool ShouldTransitionCrossSite(); | 365 bool ShouldTransitionCrossSite(); |
| 342 | 366 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 // The |pending_web_ui_| may be non-NULL even when the | 466 // The |pending_web_ui_| may be non-NULL even when the |
| 443 // |pending_render_frame_host_| is NULL. This will happen when we're | 467 // |pending_render_frame_host_| is NULL. This will happen when we're |
| 444 // transitioning between two Web UI pages: the RFH won't be swapped, so the | 468 // transitioning between two Web UI pages: the RFH won't be swapped, so the |
| 445 // pending pointer will be unused, but there will be a pending Web UI | 469 // pending pointer will be unused, but there will be a pending Web UI |
| 446 // associated with the navigation. | 470 // associated with the navigation. |
| 447 scoped_ptr<RenderFrameHostImpl> pending_render_frame_host_; | 471 scoped_ptr<RenderFrameHostImpl> pending_render_frame_host_; |
| 448 | 472 |
| 449 // Tracks information about any current pending cross-process navigation. | 473 // Tracks information about any current pending cross-process navigation. |
| 450 scoped_ptr<PendingNavigationParams> pending_nav_params_; | 474 scoped_ptr<PendingNavigationParams> pending_nav_params_; |
| 451 | 475 |
| 476 // Tracks information about any navigation paused after receiving response | |
| 477 // headers. | |
| 478 scoped_ptr<ResponseStartedParams> response_started_params_; | |
| 479 | |
| 452 // If either of these is non-NULL, the pending navigation is to a chrome: | 480 // If either of these is non-NULL, the pending navigation is to a chrome: |
| 453 // page. The scoped_ptr is used if pending_web_ui_ != web_ui_, the WeakPtr is | 481 // page. The scoped_ptr is used if pending_web_ui_ != web_ui_, the WeakPtr is |
| 454 // used for when they reference the same object. If either is non-NULL, the | 482 // used for when they reference the same object. If either is non-NULL, the |
| 455 // other should be NULL. | 483 // other should be NULL. |
| 456 scoped_ptr<WebUIImpl> pending_web_ui_; | 484 scoped_ptr<WebUIImpl> pending_web_ui_; |
| 457 base::WeakPtr<WebUIImpl> pending_and_current_web_ui_; | 485 base::WeakPtr<WebUIImpl> pending_and_current_web_ui_; |
| 458 | 486 |
| 459 // A map of site instance ID to RenderFrameProxyHosts. | 487 // A map of site instance ID to RenderFrameProxyHosts. |
| 460 typedef base::hash_map<int32, RenderFrameProxyHost*> RenderFrameProxyHostMap; | 488 typedef base::hash_map<int32, RenderFrameProxyHost*> RenderFrameProxyHostMap; |
| 461 RenderFrameProxyHostMap proxy_hosts_; | 489 RenderFrameProxyHostMap proxy_hosts_; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 479 CrossProcessFrameConnector* cross_process_frame_connector_; | 507 CrossProcessFrameConnector* cross_process_frame_connector_; |
| 480 | 508 |
| 481 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 509 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 482 | 510 |
| 483 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 511 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 484 }; | 512 }; |
| 485 | 513 |
| 486 } // namespace content | 514 } // namespace content |
| 487 | 515 |
| 488 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 516 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |