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 <list> | 8 #include <list> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "content/browser/renderer_host/render_view_host_delegate.h" | 14 #include "content/browser/renderer_host/render_view_host_delegate.h" |
15 #include "content/browser/site_instance_impl.h" | 15 #include "content/browser/site_instance_impl.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/public/browser/global_request_id.h" | 17 #include "content/public/browser/global_request_id.h" |
18 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
20 #include "content/public/common/referrer.h" | 20 #include "content/public/common/referrer.h" |
21 #include "ui/base/page_transition_types.h" | 21 #include "ui/base/page_transition_types.h" |
22 | 22 |
23 struct FrameHostMsg_BeginNavigation_Params; | |
23 struct FrameMsg_Navigate_Params; | 24 struct FrameMsg_Navigate_Params; |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 class BrowserContext; | 27 class BrowserContext; |
27 class CrossProcessFrameConnector; | 28 class CrossProcessFrameConnector; |
28 class CrossSiteTransferringRequest; | 29 class CrossSiteTransferringRequest; |
30 class FrameTreeNode; | |
29 class InterstitialPageImpl; | 31 class InterstitialPageImpl; |
30 class FrameTreeNode; | |
31 class NavigationControllerImpl; | 32 class NavigationControllerImpl; |
32 class NavigationEntry; | 33 class NavigationEntry; |
33 class NavigationEntryImpl; | 34 class NavigationEntryImpl; |
34 class RenderFrameHost; | 35 class RenderFrameHost; |
35 class RenderFrameHostDelegate; | 36 class RenderFrameHostDelegate; |
36 class RenderFrameHost; | |
37 class RenderFrameHostImpl; | 37 class RenderFrameHostImpl; |
38 class RenderFrameHostManagerTest; | 38 class RenderFrameHostManagerTest; |
39 class RenderFrameProxyHost; | 39 class RenderFrameProxyHost; |
40 class RenderViewHost; | 40 class RenderViewHost; |
41 class RenderViewHostImpl; | 41 class RenderViewHostImpl; |
42 class RenderWidgetHostDelegate; | 42 class RenderWidgetHostDelegate; |
43 class RenderWidgetHostView; | 43 class RenderWidgetHostView; |
44 class TestWebContents; | 44 class TestWebContents; |
45 class WebUIImpl; | 45 class WebUIImpl; |
46 struct CommonNavigationParams; | |
46 | 47 |
47 // Manages RenderFrameHosts for a FrameTreeNode. It maintains a | 48 // Manages RenderFrameHosts for a FrameTreeNode. It maintains a |
48 // current_frame_host() which is the content currently visible to the user. When | 49 // current_frame_host() which is the content currently visible to the user. When |
49 // a frame is told to navigate to a different web site (as determined by | 50 // a frame is told to navigate to a different web site (as determined by |
50 // SiteInstance), it will replace its current RenderFrameHost with a new | 51 // SiteInstance), it will replace its current RenderFrameHost with a new |
51 // RenderFrameHost dedicated to the new SiteInstance, possibly in a new process. | 52 // RenderFrameHost dedicated to the new SiteInstance, possibly in a new process. |
52 // | 53 // |
53 // Cross-process navigation works like this: | 54 // Cross-process navigation works like this: |
54 // | 55 // |
55 // - RFHM::Navigate determines whether the destination is cross-site, and if so, | 56 // - RFHM::Navigate determines whether the destination is cross-site, and if so, |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 | 225 |
225 // Returns the current committed Web UI or NULL if none applies. | 226 // Returns the current committed Web UI or NULL if none applies. |
226 WebUIImpl* web_ui() const { return web_ui_.get(); } | 227 WebUIImpl* web_ui() const { return web_ui_.get(); } |
227 | 228 |
228 // Returns the Web UI for the pending navigation, or NULL of none applies. | 229 // Returns the Web UI for the pending navigation, or NULL of none applies. |
229 WebUIImpl* pending_web_ui() const { | 230 WebUIImpl* pending_web_ui() const { |
230 return pending_web_ui_.get() ? pending_web_ui_.get() : | 231 return pending_web_ui_.get() ? pending_web_ui_.get() : |
231 pending_and_current_web_ui_.get(); | 232 pending_and_current_web_ui_.get(); |
232 } | 233 } |
233 | 234 |
234 // Sets the pending Web UI for the pending navigation, ensuring that the | |
235 // bindings are appropriate compared to |bindings|. | |
236 void SetPendingWebUI(const GURL& url, int bindings); | |
237 | |
238 // Called when we want to instruct the renderer to navigate to the given | 235 // Called when we want to instruct the renderer to navigate to the given |
239 // navigation entry. It may create a new RenderFrameHost or re-use an existing | 236 // navigation entry. It may create a new RenderFrameHost or re-use an existing |
240 // one. The RenderFrameHost to navigate will be returned. Returns NULL if one | 237 // one. The RenderFrameHost to navigate will be returned. Returns NULL if one |
241 // could not be created. | 238 // could not be created. |
242 RenderFrameHostImpl* Navigate(const NavigationEntryImpl& entry); | 239 RenderFrameHostImpl* Navigate(const NavigationEntryImpl& entry); |
243 | 240 |
244 // Instructs the various live views to stop. Called when the user directed the | 241 // Instructs the various live views to stop. Called when the user directed the |
245 // page to stop loading. | 242 // page to stop loading. |
246 void Stop(); | 243 void Stop(); |
247 | 244 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 | 284 |
288 // Resume navigation paused after receiving response headers. | 285 // Resume navigation paused after receiving response headers. |
289 void ResumeResponseDeferredAtStart(); | 286 void ResumeResponseDeferredAtStart(); |
290 | 287 |
291 // Clear navigation transition data. | 288 // Clear navigation transition data. |
292 void ClearNavigationTransitionData(); | 289 void ClearNavigationTransitionData(); |
293 | 290 |
294 // Called when a renderer's frame navigates. | 291 // Called when a renderer's frame navigates. |
295 void DidNavigateFrame(RenderFrameHostImpl* render_frame_host); | 292 void DidNavigateFrame(RenderFrameHostImpl* render_frame_host); |
296 | 293 |
294 // PlzNavigate | |
295 // Cleans up ongoing navigation data. | |
296 void CancelNavigation(); | |
clamy
2014/11/19 15:03:29
nit: place this function with the other PlzNavigat
carlosk
2014/11/19 17:24:29
Done.
carlosk
2014/11/21 14:36:34
Done.
| |
297 | |
297 // Called when a renderer sets its opener to null. | 298 // Called when a renderer sets its opener to null. |
298 void DidDisownOpener(RenderFrameHost* render_frame_host); | 299 void DidDisownOpener(RenderFrameHost* render_frame_host); |
299 | 300 |
300 // Helper method to create and initialize a RenderFrameHost. If |swapped_out| | 301 // Creates and initializes a RenderFrameHost that is placed on the swapped out |
301 // is true, it will be initially placed on the swapped out hosts list. | 302 // hosts list and hidden. Returns the routing id of the *view* associated |
302 // Returns the routing id of the *view* associated with the frame. | 303 // with the frame. |
303 int CreateRenderFrame(SiteInstance* instance, | 304 int CreateSwappedOutHiddenRenderFrame(SiteInstance* instance, |
304 int opener_route_id, | 305 int opener_route_id, |
305 bool swapped_out, | 306 bool for_main_frame_navigation); |
306 bool for_main_frame_navigation, | |
307 bool hidden); | |
308 | 307 |
309 // Helper method to create and initialize a RenderFrameProxyHost and return | 308 // Helper method to create and initialize a RenderFrameProxyHost and return |
310 // its routing id. | 309 // its routing id. |
311 int CreateRenderFrameProxy(SiteInstance* instance); | 310 int CreateRenderFrameProxy(SiteInstance* instance); |
312 | 311 |
313 // Sets the passed passed interstitial as the currently showing interstitial. | 312 // Sets the passed passed interstitial as the currently showing interstitial. |
314 // |interstitial_page| should be non NULL (use the remove_interstitial_page | 313 // |interstitial_page| should be non NULL (use the remove_interstitial_page |
315 // method to unset the interstitial) and no interstitial page should be set | 314 // method to unset the interstitial) and no interstitial page should be set |
316 // when there is already a non NULL interstitial page set. | 315 // when there is already a non NULL interstitial page set. |
317 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { | 316 void set_interstitial_page(InterstitialPageImpl* interstitial_page) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 | 354 |
356 // Deletes any proxy hosts associated with this node. Used during destruction | 355 // Deletes any proxy hosts associated with this node. Used during destruction |
357 // of WebContentsImpl. | 356 // of WebContentsImpl. |
358 void ResetProxyHosts(); | 357 void ResetProxyHosts(); |
359 | 358 |
360 // Returns the routing id for a RenderFrameHost or RenderFrameHostProxy | 359 // Returns the routing id for a RenderFrameHost or RenderFrameHostProxy |
361 // that has the given SiteInstance and is associated with this | 360 // that has the given SiteInstance and is associated with this |
362 // RenderFrameHostManager. Returns MSG_ROUTING_NONE if none is found. | 361 // RenderFrameHostManager. Returns MSG_ROUTING_NONE if none is found. |
363 int GetRoutingIdForSiteInstance(SiteInstance* site_instance); | 362 int GetRoutingIdForSiteInstance(SiteInstance* site_instance); |
364 | 363 |
365 // PlzNavigate: Called when a navigation is ready to commit, to select the | 364 // PlzNavigate |
366 // renderer that will commit it. | 365 // Notifies the RFHM that a navigation is about to begin so that it can |
366 // speculatively spawn a new renderer process if needed. | |
367 void BeginNavigation(const FrameHostMsg_BeginNavigation_Params& params, | |
368 const CommonNavigationParams& common_params); | |
369 | |
370 // PlzNavigate | |
371 // Called when a navigation is ready to commit, to select the renderer that | |
372 // will commit it. | |
367 RenderFrameHostImpl* GetFrameHostForNavigation(const GURL& url, | 373 RenderFrameHostImpl* GetFrameHostForNavigation(const GURL& url, |
368 ui::PageTransition transition); | 374 ui::PageTransition transition); |
369 | 375 |
376 // PlzNavigate | |
377 // Returns the speculative RenderFrameHost, or NULL if there is no pending | |
378 // one. | |
379 RenderFrameHostImpl* speculative_render_frame_host() const { | |
380 return speculative_render_frame_host_.get(); | |
381 } | |
382 | |
370 private: | 383 private: |
371 friend class RenderFrameHostManagerTest; | 384 friend class RenderFrameHostManagerTest; |
372 friend class TestWebContents; | 385 friend class TestWebContents; |
373 | 386 |
374 FRIEND_TEST_ALL_PREFIXES(CrossProcessFrameTreeBrowserTest, | 387 FRIEND_TEST_ALL_PREFIXES(CrossProcessFrameTreeBrowserTest, |
375 CreateCrossProcessSubframeProxies); | 388 CreateCrossProcessSubframeProxies); |
376 | 389 |
377 // Used with FrameTree::ForEach to erase RenderFrameProxyHosts from a | 390 // Used with FrameTree::ForEach to erase RenderFrameProxyHosts from a |
378 // FrameTreeNode's RenderFrameHostManager. | 391 // FrameTreeNode's RenderFrameHostManager. |
379 static bool ClearProxiesInSiteInstance(int32 site_instance_id, | 392 static bool ClearProxiesInSiteInstance(int32 site_instance_id, |
(...skipping 17 matching lines...) Expand all Loading... | |
397 // SiteInstance's site and when we later call IsSameWebSite. If there is no | 410 // SiteInstance's site and when we later call IsSameWebSite. If there is no |
398 // current NavigationEntry, check the current SiteInstance's site, which might | 411 // current NavigationEntry, check the current SiteInstance's site, which might |
399 // already be committed to a Web UI URL (such as the NTP). | 412 // already be committed to a Web UI URL (such as the NTP). |
400 bool ShouldSwapBrowsingInstancesForNavigation( | 413 bool ShouldSwapBrowsingInstancesForNavigation( |
401 const GURL& current_effective_url, | 414 const GURL& current_effective_url, |
402 bool current_is_view_source_mode, | 415 bool current_is_view_source_mode, |
403 SiteInstance* new_site_instance, | 416 SiteInstance* new_site_instance, |
404 const GURL& new_effective_url, | 417 const GURL& new_effective_url, |
405 bool new_is_view_source_mode) const; | 418 bool new_is_view_source_mode) const; |
406 | 419 |
420 // Sets the pending Web UI for the pending navigation, ensuring that the | |
421 // bindings are appropriate compared to |bindings|. | |
422 void SetPendingWebUI(const GURL& url, int bindings); | |
423 | |
424 // Creates a new Web UI, ensuring that the bindings are appropriate compared | |
425 // to |bindings|. The caller is responsible for the instance ownership. | |
426 WebUIImpl* CreateWebUI(const GURL& url, int bindings); | |
427 | |
407 // Returns true if it is safe to reuse the current WebUI when navigating from | 428 // Returns true if it is safe to reuse the current WebUI when navigating from |
408 // |current_entry| to |new_url|. | 429 // |current_entry| to |new_url|. |
409 bool ShouldReuseWebUI( | 430 bool ShouldReuseWebUI( |
410 const NavigationEntry* current_entry, | 431 const NavigationEntry* current_entry, |
411 const GURL& new_url) const; | 432 const GURL& new_url) const; |
412 | 433 |
413 // Returns the SiteInstance to use for the navigation. | 434 // Returns the SiteInstance to use for the navigation. |
414 SiteInstance* GetSiteInstanceForNavigation( | 435 SiteInstance* GetSiteInstanceForNavigation( |
415 const GURL& dest_url, | 436 const GURL& dest_url, |
416 SiteInstance* dest_instance, | 437 SiteInstance* dest_instance, |
417 ui::PageTransition dest_transition, | 438 ui::PageTransition dest_transition, |
418 bool dest_is_restore, | 439 bool dest_is_restore, |
419 bool dest_is_view_source_mode); | 440 bool dest_is_view_source_mode); |
420 | 441 |
421 // Returns an appropriate SiteInstance object for the given |dest_url|, | 442 // Returns an appropriate SiteInstance object for the given |dest_url|, |
422 // possibly reusing the current SiteInstance. If --process-per-tab is used, | 443 // possibly reusing the current SiteInstance. If --process-per-tab is used, |
423 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns | 444 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns |
424 // true. |dest_instance| will be used if it is not null. | 445 // true. |dest_instance| will be used if it is not null. |
425 // This is a helper function for GetSiteInstanceForNavigation. | 446 // This is a helper function for GetSiteInstanceForNavigation. |
426 SiteInstance* GetSiteInstanceForURL( | 447 SiteInstance* GetSiteInstanceForURL(const GURL& dest_url, |
427 const GURL& dest_url, | 448 SiteInstance* dest_instance, |
428 SiteInstance* dest_instance, | 449 ui::PageTransition dest_transition, |
429 ui::PageTransition dest_transition, | 450 bool dest_is_restore, |
430 bool dest_is_restore, | 451 bool dest_is_view_source_mode, |
431 bool dest_is_view_source_mode, | 452 SiteInstance* current_instance, |
432 SiteInstance* current_instance, | 453 bool force_browsing_instance_swap); |
433 bool force_browsing_instance_swap); | |
434 | 454 |
435 // Determines the appropriate url to use as the current url for SiteInstance | 455 // Determines the appropriate url to use as the current url for SiteInstance |
436 // selection. | 456 // selection. |
437 const GURL& GetCurrentURLForSiteInstance( | 457 const GURL& GetCurrentURLForSiteInstance( |
438 SiteInstance* current_instance, | 458 SiteInstance* current_instance, |
439 NavigationEntry* current_entry); | 459 NavigationEntry* current_entry); |
440 | 460 |
441 // Creates a new RenderFrameHostImpl for the |new_instance| while respecting | 461 // Creates a new RenderFrameHostImpl for the |new_instance| while respecting |
442 // the opener route if needed and stores it in pending_render_frame_host_. | 462 // the opener route if needed and stores it in pending_render_frame_host_. |
443 void CreateRenderFrameHostForNewSiteInstance( | 463 void CreateRenderFrameHostForNewSiteInstance( |
444 SiteInstance* old_instance, | 464 SiteInstance* old_instance, |
445 SiteInstance* new_instance, | 465 SiteInstance* new_instance, |
446 bool is_main_frame); | 466 bool is_main_frame); |
447 | 467 |
468 // Ensure that we have created RFHs for the new RFH's opener chain if | |
469 // we are staying in the same BrowsingInstance. This allows the new RFH | |
470 // to send cross-process script calls to its opener(s). Returns the opener | |
471 // route ID to be used for the new RenderView to be created. | |
472 int GetOpenerRouteIDForNewRenderView(SiteInstance* old_instance, | |
473 SiteInstance* new_instance); | |
474 | |
475 // Helper method to create and initialize a RenderFrameHost. If |swapped_out| | |
476 // is true, it will be initially placed on the swapped out hosts list. | |
477 // If |routing_id_ptr| is not NULL it will be set to the routing id of the | |
478 // *view* associated with the frame. | |
479 scoped_ptr<RenderFrameHostImpl> CreateRenderFrameInternal( | |
480 SiteInstance* instance, | |
481 int opener_route_id, | |
482 bool swapped_out, | |
483 bool for_main_frame_navigation, | |
484 bool hidden, | |
485 const WebUIImpl* web_ui, | |
486 int* routing_id_ptr); | |
487 | |
448 // Creates a RenderFrameHost and corresponding RenderViewHost if necessary. | 488 // Creates a RenderFrameHost and corresponding RenderViewHost if necessary. |
449 scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance, | 489 scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance, |
450 int view_routing_id, | 490 int view_routing_id, |
451 int frame_routing_id, | 491 int frame_routing_id, |
452 bool swapped_out, | 492 bool swapped_out, |
453 bool hidden); | 493 bool hidden); |
454 | 494 |
495 // PlzNavigate | |
496 // Creates a new RenderFrameHost and does all required supporting work for the | |
497 // speculative creation of a new renderer for an ongoing navigation request. | |
498 // This RenderFrameHost might be destroyed later if the final navigation | |
499 // destination doesn't match the initial one. | |
500 bool CreateSpeculativeRenderFrameHost(const GURL& url, | |
501 SiteInstance* old_instance, | |
502 SiteInstance* new_instance, | |
503 int bindings); | |
504 | |
505 // PlzNavigate | |
506 // Cleans up the date related to the speculative RenderFrameHost. | |
507 void CleanUpSpeculativeRenderFrameHost(); | |
508 | |
455 // Sets up the necessary state for a new RenderViewHost with the given opener, | 509 // Sets up the necessary state for a new RenderViewHost with the given opener, |
456 // if necessary. It creates a RenderFrameProxy in the target renderer process | 510 // if necessary. It creates a RenderFrameProxy in the target renderer process |
457 // with the given |proxy_routing_id|, which is used to route IPC messages when | 511 // with the given |proxy_routing_id|, which is used to route IPC messages when |
458 // in swapped out state. Returns early if the RenderViewHost has already been | 512 // in swapped out state. Returns early if the RenderViewHost has already been |
459 // initialized for another RenderFrameHost. | 513 // initialized for another RenderFrameHost. |
460 // TODO(creis): opener_route_id is currently for the RenderViewHost but should | 514 // TODO(creis): opener_route_id is currently for the RenderViewHost but should |
461 // be for the RenderFrame, since frames can have openers. | 515 // be for the RenderFrame, since frames can have openers. |
462 bool InitRenderView(RenderViewHostImpl* render_view_host, | 516 bool InitRenderView(RenderViewHostImpl* render_view_host, |
463 int opener_route_id, | 517 int opener_route_id, |
464 int proxy_routing_id, | 518 int proxy_routing_id, |
465 bool for_main_frame_navigation); | 519 bool for_main_frame_navigation); |
466 | 520 |
467 // Initialization for RenderFrameHost uses the same sequence as InitRenderView | 521 // Initialization for RenderFrameHost uses the same sequence as InitRenderView |
468 // above. | 522 // above. |
469 bool InitRenderFrame(RenderFrameHostImpl* render_frame_host); | 523 bool InitRenderFrame(RenderFrameHostImpl* render_frame_host); |
470 | 524 |
471 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this | 525 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this |
472 // doesn't require the pending render_frame_host_ pointer to be non-NULL, | 526 // doesn't require the pending render_frame_host_ pointer to be non-NULL, |
473 // since there could be Web UI switching as well. Call this for every commit. | 527 // since there could be Web UI switching as well. Call this for every commit. |
474 void CommitPending(); | 528 // With PlzNavigate enabled, |use_speculative_rfh| can be set to true which |
529 // will cause the speculative RenderFrameHost to be the active one. | |
530 void CommitPending(bool use_speculative_rfh); | |
475 | 531 |
476 // Runs the unload handler in the old RenderFrameHost, after the new | 532 // Runs the unload handler in the old RenderFrameHost, after the new |
477 // RenderFrameHost has committed. |old_render_frame_host| will either be | 533 // RenderFrameHost has committed. |old_render_frame_host| will either be |
478 // deleted or put on the pending delete list during this call. | 534 // deleted or put on the pending delete list during this call. |
479 void SwapOutOldFrame(scoped_ptr<RenderFrameHostImpl> old_render_frame_host); | 535 void SwapOutOldFrame(scoped_ptr<RenderFrameHostImpl> old_render_frame_host); |
480 | 536 |
537 // Called to properly discard a created RenderFrameHost that was never made | |
538 // active (for active ones SwapOutOldFrame is used instead). It can be swapped | |
539 // out or fully destroyed. | |
540 void RecycleRenderFrameHost( | |
541 scoped_ptr<RenderFrameHostImpl> render_frame_host); | |
542 | |
481 // Holds |render_frame_host| until it can be deleted when its swap out ACK | 543 // Holds |render_frame_host| until it can be deleted when its swap out ACK |
482 // arrives. | 544 // arrives. |
483 void MoveToPendingDeleteHosts( | 545 void MoveToPendingDeleteHosts( |
484 scoped_ptr<RenderFrameHostImpl> render_frame_host); | 546 scoped_ptr<RenderFrameHostImpl> render_frame_host); |
485 | 547 |
486 // Shutdown all RenderFrameProxyHosts in a SiteInstance. This is called to | 548 // Shutdown all RenderFrameProxyHosts in a SiteInstance. This is called to |
487 // shutdown frames when all the frames in a SiteInstance are confirmed to be | 549 // shutdown frames when all the frames in a SiteInstance are confirmed to be |
488 // swapped out. | 550 // swapped out. |
489 void ShutdownRenderFrameProxyHostsInSiteInstance(int32 site_instance_id); | 551 void ShutdownRenderFrameProxyHostsInSiteInstance(int32 site_instance_id); |
490 | 552 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
577 RFHPendingDeleteList pending_delete_hosts_; | 639 RFHPendingDeleteList pending_delete_hosts_; |
578 | 640 |
579 // The intersitial page currently shown if any, not own by this class | 641 // The intersitial page currently shown if any, not own by this class |
580 // (the InterstitialPage is self-owned, it deletes itself when hidden). | 642 // (the InterstitialPage is self-owned, it deletes itself when hidden). |
581 InterstitialPageImpl* interstitial_page_; | 643 InterstitialPageImpl* interstitial_page_; |
582 | 644 |
583 NotificationRegistrar registrar_; | 645 NotificationRegistrar registrar_; |
584 | 646 |
585 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 647 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
586 | 648 |
649 // PlzNavigate | |
650 // Members to store the speculative RFH created upon starting a navigation | |
651 // allowing the creation of the renderer process as early as possible. | |
652 // Might be discarded later on if the final URL's SiteInstance doesn't match | |
653 // what was assumed in the beginning. | |
654 // Note: speculative RenderFrameHost is only used for PlzNavigate and pending | |
655 // only for the regular navigation (not yet true, but will be). | |
656 scoped_ptr<RenderFrameHostImpl> speculative_render_frame_host_; | |
657 scoped_ptr<WebUIImpl> speculative_web_ui_; | |
658 | |
659 // PlzNavigate | |
660 // If true at navigation commit time the current WebUI will be kept instead of | |
661 // creating a new one. | |
662 bool should_reuse_web_ui_; | |
nasko
2014/11/19 01:00:24
Can we avoid adding yet more state?
carlosk
2014/11/19 17:24:29
As WebUI instances are held with scoped_ptr I can'
| |
663 | |
587 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 664 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
588 }; | 665 }; |
589 | 666 |
590 } // namespace content | 667 } // namespace content |
591 | 668 |
592 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 669 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |