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 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "content/browser/frame_host/render_frame_host_impl.h" | |
15 #include "content/browser/renderer_host/render_view_host_delegate.h" | 16 #include "content/browser/renderer_host/render_view_host_delegate.h" |
16 #include "content/browser/site_instance_impl.h" | 17 #include "content/browser/site_instance_impl.h" |
17 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
18 #include "content/public/browser/global_request_id.h" | 19 #include "content/public/browser/global_request_id.h" |
19 #include "content/public/common/referrer.h" | 20 #include "content/public/common/referrer.h" |
20 #include "ui/base/page_transition_types.h" | 21 #include "ui/base/page_transition_types.h" |
21 #include "url/origin.h" | 22 #include "url/origin.h" |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 class BrowserContext; | 25 class BrowserContext; |
25 class CrossProcessFrameConnector; | 26 class CrossProcessFrameConnector; |
26 class CrossSiteTransferringRequest; | 27 class CrossSiteTransferringRequest; |
27 class FrameNavigationEntry; | 28 class FrameNavigationEntry; |
28 class FrameTreeNode; | 29 class FrameTreeNode; |
29 class InterstitialPageImpl; | 30 class InterstitialPageImpl; |
30 class NavigationControllerImpl; | 31 class NavigationControllerImpl; |
31 class NavigationEntry; | 32 class NavigationEntry; |
32 class NavigationEntryImpl; | 33 class NavigationEntryImpl; |
33 class NavigationHandleImpl; | 34 class NavigationHandleImpl; |
34 class NavigationRequest; | 35 class NavigationRequest; |
35 class NavigatorTestWithBrowserSideNavigation; | 36 class NavigatorTestWithBrowserSideNavigation; |
36 class RenderFrameHost; | |
37 class RenderFrameHostDelegate; | 37 class RenderFrameHostDelegate; |
38 class RenderFrameHostImpl; | |
39 class RenderFrameHostManagerTest; | 38 class RenderFrameHostManagerTest; |
40 class RenderFrameProxyHost; | 39 class RenderFrameProxyHost; |
41 class RenderViewHost; | 40 class RenderViewHost; |
42 class RenderViewHostImpl; | 41 class RenderViewHostImpl; |
43 class RenderWidgetHostDelegate; | 42 class RenderWidgetHostDelegate; |
44 class RenderWidgetHostView; | 43 class RenderWidgetHostView; |
45 class TestWebContents; | 44 class TestWebContents; |
46 class WebUIImpl; | 45 class WebUIImpl; |
47 struct CommonNavigationParams; | 46 struct CommonNavigationParams; |
48 struct FrameReplicationState; | 47 struct FrameReplicationState; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 RenderFrameHost* new_host, | 140 RenderFrameHost* new_host, |
142 bool is_main_frame) = 0; | 141 bool is_main_frame) = 0; |
143 // TODO(nasko): This should be removed once extensions no longer use | 142 // TODO(nasko): This should be removed once extensions no longer use |
144 // NotificationService. See https://crbug.com/462682. | 143 // NotificationService. See https://crbug.com/462682. |
145 virtual void NotifyMainFrameSwappedFromRenderManager( | 144 virtual void NotifyMainFrameSwappedFromRenderManager( |
146 RenderViewHost* old_host, | 145 RenderViewHost* old_host, |
147 RenderViewHost* new_host) = 0; | 146 RenderViewHost* new_host) = 0; |
148 virtual NavigationControllerImpl& | 147 virtual NavigationControllerImpl& |
149 GetControllerForRenderManager() = 0; | 148 GetControllerForRenderManager() = 0; |
150 | 149 |
151 // Creates a WebUI object for the given URL if one applies. Ownership of the | |
152 // returned pointer will be passed to the caller. If no WebUI applies, | |
153 // returns NULL. | |
154 virtual scoped_ptr<WebUIImpl> CreateWebUIForRenderManager( | |
155 const GURL& url) = 0; | |
156 | |
157 // Returns the navigation entry of the current navigation, or NULL if there | 150 // Returns the navigation entry of the current navigation, or NULL if there |
158 // is none. | 151 // is none. |
159 virtual NavigationEntry* | 152 virtual NavigationEntry* |
160 GetLastCommittedNavigationEntryForRenderManager() = 0; | 153 GetLastCommittedNavigationEntryForRenderManager() = 0; |
161 | 154 |
162 // Returns true if the location bar should be focused by default rather than | 155 // Returns true if the location bar should be focused by default rather than |
163 // the page contents. The view calls this function when the tab is focused | 156 // the page contents. The view calls this function when the tab is focused |
164 // to see what it should do. | 157 // to see what it should do. |
165 virtual bool FocusLocationBarByDefault() = 0; | 158 virtual bool FocusLocationBarByDefault() = 0; |
166 | 159 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
239 // SiteInstance. Returns nullptr if this WebContents isn't part of inner/outer | 232 // SiteInstance. Returns nullptr if this WebContents isn't part of inner/outer |
240 // relationship. | 233 // relationship. |
241 RenderFrameProxyHost* GetProxyToOuterDelegate(); | 234 RenderFrameProxyHost* GetProxyToOuterDelegate(); |
242 | 235 |
243 // Removes the FrameTreeNode in the outer WebContents that represents this | 236 // Removes the FrameTreeNode in the outer WebContents that represents this |
244 // FrameTreeNode. | 237 // FrameTreeNode. |
245 // TODO(lazyboy): This does not belong to RenderFrameHostManager, move it to | 238 // TODO(lazyboy): This does not belong to RenderFrameHostManager, move it to |
246 // somehwere else. | 239 // somehwere else. |
247 void RemoveOuterDelegateFrame(); | 240 void RemoveOuterDelegateFrame(); |
248 | 241 |
249 // Returns the pending RenderFrameHost, or NULL if there is no pending one. | 242 // Returns the pending RenderFrameHost, or null if there is no pending one. |
250 RenderFrameHostImpl* pending_frame_host() const { | 243 RenderFrameHostImpl* pending_frame_host() const { |
251 return pending_render_frame_host_.get(); | 244 return pending_render_frame_host_.get(); |
252 } | 245 } |
253 | 246 |
254 // Returns the speculative RenderFrameHost, or null if there is no speculative | 247 // Returns the speculative RenderFrameHost, or null if there is no speculative |
255 // one. | 248 // one. |
256 RenderFrameHostImpl* speculative_frame_host() const { | 249 RenderFrameHostImpl* speculative_frame_host() const { |
257 return speculative_render_frame_host_.get(); | 250 return speculative_render_frame_host_.get(); |
258 } | 251 } |
259 | 252 |
260 // TODO(creis): Remove this when we no longer use RVH for navigation. | 253 // TODO(creis): Remove this when we no longer use RVH for navigation. |
261 RenderViewHostImpl* pending_render_view_host() const; | 254 RenderViewHostImpl* pending_render_view_host() const; |
262 | 255 |
263 // Returns the current committed Web UI or NULL if none applies. | 256 // Returns the current committed WebUI or null if none applies. |
264 WebUIImpl* web_ui() const { return web_ui_.get(); } | 257 WebUIImpl* web_ui() const { return render_frame_host_->web_ui(); } |
265 | 258 |
266 // Returns the Web UI for the pending navigation, or NULL of none applies. | 259 // Returns the WebUI for the pending navigation, or null of none applies. |
267 WebUIImpl* pending_web_ui() const { | 260 WebUIImpl* pending_web_ui() const { |
268 return pending_web_ui_.get() ? pending_web_ui_.get() : | 261 return pending_render_frame_host_ ? pending_render_frame_host_->web_ui() |
269 pending_and_current_web_ui_.get(); | 262 : render_frame_host_->pending_web_ui(); |
270 } | 263 } |
271 | 264 |
272 // PlzNavigate | 265 // PlzNavigate |
273 // Returns the speculative WebUI for the navigation (a newly created one or | 266 // Returns the speculative WebUI for the navigation (a newly created one or |
274 // the current one if it should be reused). If none is set returns nullptr. | 267 // the current one if it should be reused). If none is set returns null. |
275 WebUIImpl* speculative_web_ui() const { | 268 WebUIImpl* speculative_web_ui() const { |
276 return should_reuse_web_ui_ ? web_ui_.get() : speculative_web_ui_.get(); | 269 return speculative_render_frame_host_ |
270 ? speculative_render_frame_host_->web_ui() | |
271 : render_frame_host_->pending_web_ui(); | |
277 } | 272 } |
278 | 273 |
279 // Called when we want to instruct the renderer to navigate to the given | 274 // Called when we want to instruct the renderer to navigate to the given |
280 // navigation entry. It may create a new RenderFrameHost or re-use an existing | 275 // navigation entry. It may create a new RenderFrameHost or re-use an existing |
281 // one. The RenderFrameHost to navigate will be returned. Returns NULL if one | 276 // one. The RenderFrameHost to navigate will be returned. Returns NULL if one |
282 // could not be created. |dest_url| takes precedence over the |frame_entry|'s | 277 // could not be created. |dest_url| takes precedence over the |frame_entry|'s |
283 // url (this is necessary because ReloadOriginalRequest navigates to a | 278 // url (this is necessary because ReloadOriginalRequest navigates to a |
284 // different URL than the last committed entry, without modifying it). | 279 // different URL than the last committed entry, without modifying it). |
285 RenderFrameHostImpl* Navigate(const GURL& dest_url, | 280 RenderFrameHostImpl* Navigate(const GURL& dest_url, |
286 const FrameNavigationEntry& frame_entry, | 281 const FrameNavigationEntry& frame_entry, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
343 | 338 |
344 // Called when this frame's opener is changed to the frame specified by | 339 // Called when this frame's opener is changed to the frame specified by |
345 // |opener_routing_id| in |source_site_instance|'s process. This change | 340 // |opener_routing_id| in |source_site_instance|'s process. This change |
346 // could come from either the current RenderFrameHost or one of the | 341 // could come from either the current RenderFrameHost or one of the |
347 // proxies (e.g., window.open that targets a RemoteFrame by name). The | 342 // proxies (e.g., window.open that targets a RemoteFrame by name). The |
348 // updated opener will be forwarded to any other RenderFrameProxies and | 343 // updated opener will be forwarded to any other RenderFrameProxies and |
349 // RenderFrames for this FrameTreeNode. | 344 // RenderFrames for this FrameTreeNode. |
350 void DidChangeOpener(int opener_routing_id, | 345 void DidChangeOpener(int opener_routing_id, |
351 SiteInstance* source_site_instance); | 346 SiteInstance* source_site_instance); |
352 | 347 |
353 // Sets the pending Web UI for the pending navigation, ensuring that the | 348 // Creates and initializes a RenderFrameHost. If |flags| has the |
354 // bindings are appropriate compared to |bindings|. | |
355 void SetPendingWebUI(const GURL& url, int bindings); | |
356 | |
357 // Creates and initializes a RenderFrameHost. The |web_ui| is an optional | |
358 // input parameter used to double check bindings when swapping back in a | |
359 // previously existing RenderFrameHost. If |flags| has the | |
360 // CREATE_RF_SWAPPED_OUT bit set from the CreateRenderFrameFlags enum, it will | 349 // CREATE_RF_SWAPPED_OUT bit set from the CreateRenderFrameFlags enum, it will |
361 // initially be placed on the swapped out hosts list. If |view_routing_id_ptr| | 350 // initially be placed on the swapped out hosts list. If |view_routing_id_ptr| |
362 // is not nullptr it will be set to the routing id of the view associated with | 351 // is not nullptr it will be set to the routing id of the view associated with |
363 // the frame. | 352 // the frame. |
364 scoped_ptr<RenderFrameHostImpl> CreateRenderFrame(SiteInstance* instance, | 353 scoped_ptr<RenderFrameHostImpl> CreateRenderFrame(SiteInstance* instance, |
365 WebUIImpl* web_ui, | |
366 int flags, | 354 int flags, |
367 int* view_routing_id_ptr); | 355 int* view_routing_id_ptr); |
368 | 356 |
369 // Helper method to create and initialize a RenderFrameProxyHost and return | 357 // Helper method to create and initialize a RenderFrameProxyHost and return |
370 // its routing id. | 358 // its routing id. |
371 int CreateRenderFrameProxy(SiteInstance* instance); | 359 int CreateRenderFrameProxy(SiteInstance* instance); |
372 | 360 |
373 // Creates proxies for a new child frame at FrameTreeNode |child| in all | 361 // Creates proxies for a new child frame at FrameTreeNode |child| in all |
374 // SiteInstances for which the current frame has proxies. This method is | 362 // SiteInstances for which the current frame has proxies. This method is |
375 // called on the parent of a new child frame before the child leaves the | 363 // called on the parent of a new child frame before the child leaves the |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
558 // SiteInstance's site and when we later call IsSameWebSite. If there is no | 546 // SiteInstance's site and when we later call IsSameWebSite. If there is no |
559 // current NavigationEntry, check the current SiteInstance's site, which might | 547 // current NavigationEntry, check the current SiteInstance's site, which might |
560 // already be committed to a Web UI URL (such as the NTP). | 548 // already be committed to a Web UI URL (such as the NTP). |
561 bool ShouldSwapBrowsingInstancesForNavigation( | 549 bool ShouldSwapBrowsingInstancesForNavigation( |
562 const GURL& current_effective_url, | 550 const GURL& current_effective_url, |
563 bool current_is_view_source_mode, | 551 bool current_is_view_source_mode, |
564 SiteInstance* new_site_instance, | 552 SiteInstance* new_site_instance, |
565 const GURL& new_effective_url, | 553 const GURL& new_effective_url, |
566 bool new_is_view_source_mode) const; | 554 bool new_is_view_source_mode) const; |
567 | 555 |
568 // Creates a new Web UI, ensuring that the bindings are appropriate compared | |
569 // to |bindings|. | |
570 scoped_ptr<WebUIImpl> CreateWebUI(const GURL& url, int bindings); | |
571 | |
572 // Returns true if it is safe to reuse the current WebUI when navigating from | |
573 // |current_entry| to |new_url|. | |
574 bool ShouldReuseWebUI( | |
575 const NavigationEntry* current_entry, | |
576 const GURL& new_url) const; | |
577 | |
578 // Returns the SiteInstance to use for the navigation. | 556 // Returns the SiteInstance to use for the navigation. |
579 SiteInstance* GetSiteInstanceForNavigation(const GURL& dest_url, | 557 SiteInstance* GetSiteInstanceForNavigation(const GURL& dest_url, |
580 SiteInstance* source_instance, | 558 SiteInstance* source_instance, |
581 SiteInstance* dest_instance, | 559 SiteInstance* dest_instance, |
582 SiteInstance* candidate_instance, | 560 SiteInstance* candidate_instance, |
583 ui::PageTransition transition, | 561 ui::PageTransition transition, |
584 bool dest_is_restore, | 562 bool dest_is_restore, |
585 bool dest_is_view_source_mode); | 563 bool dest_is_view_source_mode); |
586 | 564 |
587 // Returns a descriptor of the appropriate SiteInstance object for the given | 565 // Returns a descriptor of the appropriate SiteInstance object for the given |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
654 FrameTreeNode* skip_this_node); | 632 FrameTreeNode* skip_this_node); |
655 | 633 |
656 // Creates a RenderFrameHost and corresponding RenderViewHost if necessary. | 634 // Creates a RenderFrameHost and corresponding RenderViewHost if necessary. |
657 scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance, | 635 scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance, |
658 int32 view_routing_id, | 636 int32 view_routing_id, |
659 int32 frame_routing_id, | 637 int32 frame_routing_id, |
660 int32 widget_routing_id, | 638 int32 widget_routing_id, |
661 int flags); | 639 int flags); |
662 | 640 |
663 // PlzNavigate | 641 // PlzNavigate |
664 // Creates and initializes a speculative RenderFrameHost and/or WebUI for an | 642 // Creates and initializes a speculative RenderFrameHost for an ongoing |
665 // ongoing navigation. They might be destroyed and re-created later if the | 643 // navigation. They might be destroyed and re-created later if the navigation |
666 // navigation is redirected to a different SiteInstance. | 644 // is redirected to a different SiteInstance. |
667 bool CreateSpeculativeRenderFrameHost(const GURL& url, | 645 bool CreateSpeculativeRenderFrameHost(SiteInstance* old_instance, |
668 SiteInstance* old_instance, | 646 SiteInstance* new_instance); |
669 SiteInstance* new_instance, | 647 |
670 int bindings); | 648 // Initializes the WebUI for the pending/speculative RenderFrameHost that must |
649 // have been either recently created or swapped back in. | |
650 // TODO(nasko): Revise when https://crbug.com/357747 is fixed." | |
nasko
2015/10/20 01:13:22
nit: Extra quotes at the end which aren't needed.
carlosk
2015/10/20 12:58:52
Done.
| |
651 void InitializeWebUI(const GURL& url, int bindings); | |
671 | 652 |
672 // Sets up the necessary state for a new RenderViewHost. If |proxy| is not | 653 // Sets up the necessary state for a new RenderViewHost. If |proxy| is not |
673 // null, it creates a RenderFrameProxy in the target renderer process which is | 654 // null, it creates a RenderFrameProxy in the target renderer process which is |
674 // used to route IPC messages when in swapped out state. Returns early if the | 655 // used to route IPC messages when in swapped out state. Returns early if the |
675 // RenderViewHost has already been initialized for another RenderFrameHost. | 656 // RenderViewHost has already been initialized for another RenderFrameHost. |
676 bool InitRenderView(RenderViewHostImpl* render_view_host, | 657 bool InitRenderView(RenderViewHostImpl* render_view_host, |
677 RenderFrameProxyHost* proxy); | 658 RenderFrameProxyHost* proxy); |
678 | 659 |
679 // Initialization for RenderFrameHost uses the same sequence as InitRenderView | 660 // Initialization for RenderFrameHost uses the same sequence as InitRenderView |
680 // above. | 661 // above. |
681 bool InitRenderFrame(RenderFrameHostImpl* render_frame_host); | 662 bool InitRenderFrame(RenderFrameHostImpl* render_frame_host); |
682 | 663 |
683 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this | 664 // Sets the pending RenderFrameHost to be the active one. Note that if the |
684 // doesn't require the pending render_frame_host_ pointer to be non-NULL, | 665 // current one is being reused this method might switch its WebUI if there is |
685 // since there could be Web UI switching as well. Call this for every commit. | 666 // a pending one. Call this for every commit. |
686 // If PlzNavigate is enabled the method will set the speculative (not pending) | 667 // If PlzNavigate is enabled the method will set the speculative (not pending) |
687 // RenderFrameHost to be the active one. | 668 // RenderFrameHost to be the active one. |
688 void CommitPending(); | 669 void CommitPending(); |
689 | 670 |
690 // Helper to call CommitPending() in all necessary cases. | 671 // Helper to call CommitPending() in all necessary cases. |
691 void CommitPendingIfNecessary(RenderFrameHostImpl* render_frame_host, | 672 void CommitPendingIfNecessary(RenderFrameHostImpl* render_frame_host, |
692 bool was_caused_by_user_gesture); | 673 bool was_caused_by_user_gesture); |
693 | 674 |
694 // Commits any pending sandbox flag updates when the renderer's frame | 675 // Commits any pending sandbox flag updates when the renderer's frame |
695 // navigates. | 676 // navigates. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
747 | 728 |
748 // Our delegate, not owned by us. Guaranteed non-NULL. | 729 // Our delegate, not owned by us. Guaranteed non-NULL. |
749 Delegate* delegate_; | 730 Delegate* delegate_; |
750 | 731 |
751 // Implemented by the owner of this class. These delegates are installed into | 732 // Implemented by the owner of this class. These delegates are installed into |
752 // all the RenderFrameHosts that we create. | 733 // all the RenderFrameHosts that we create. |
753 RenderFrameHostDelegate* render_frame_delegate_; | 734 RenderFrameHostDelegate* render_frame_delegate_; |
754 RenderViewHostDelegate* render_view_delegate_; | 735 RenderViewHostDelegate* render_view_delegate_; |
755 RenderWidgetHostDelegate* render_widget_delegate_; | 736 RenderWidgetHostDelegate* render_widget_delegate_; |
756 | 737 |
757 // Our RenderFrameHost and its associated Web UI (if any, will be NULL for | 738 // Our RenderFrameHost which is responsible for all communication with a child |
758 // non-WebUI pages). This object is responsible for all communication with | 739 // RenderFrame instance. |
759 // a child RenderFrame instance. | |
760 // For now, RenderFrameHost keeps a RenderViewHost in its SiteInstance alive. | 740 // For now, RenderFrameHost keeps a RenderViewHost in its SiteInstance alive. |
761 // Eventually, RenderViewHost will be replaced with a page context. | 741 // Eventually, RenderViewHost will be replaced with a page context. |
762 scoped_ptr<RenderFrameHostImpl> render_frame_host_; | 742 scoped_ptr<RenderFrameHostImpl> render_frame_host_; |
763 scoped_ptr<WebUIImpl> web_ui_; | |
764 | 743 |
765 // A RenderFrameHost used to load a cross-site page. This remains hidden | 744 // A RenderFrameHost used to load a cross-site page. This remains hidden |
766 // while a cross-site request is pending until it calls DidNavigate. It may | 745 // while a cross-site request is pending until it calls DidNavigate. |
767 // have an associated Web UI, in which case the Web UI pointer will be non- | 746 // Note: This member is not used in PlzNavigate. |
768 // NULL. | |
769 // | |
770 // The |pending_web_ui_| may be non-NULL even when the | |
771 // |pending_render_frame_host_| is NULL. This will happen when we're | |
772 // transitioning between two Web UI pages: the RFH won't be swapped, so the | |
773 // pending pointer will be unused, but there will be a pending Web UI | |
774 // associated with the navigation. | |
775 // Note: This is not used in PlzNavigate. | |
776 scoped_ptr<RenderFrameHostImpl> pending_render_frame_host_; | 747 scoped_ptr<RenderFrameHostImpl> pending_render_frame_host_; |
777 | 748 |
778 // If a pending request needs to be transferred to another process, this | 749 // If a pending request needs to be transferred to another process, this |
779 // owns the request until it's transferred to the new process, so it will be | 750 // owns the request until it's transferred to the new process, so it will be |
780 // cleaned up if the navigation is cancelled. Otherwise, this is NULL. | 751 // cleaned up if the navigation is cancelled. Otherwise, this is NULL. |
781 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request_; | 752 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request_; |
782 | 753 |
783 // This is used to temporarily store the NavigationHandle during | 754 // This is used to temporarily store the NavigationHandle during |
784 // transferring navigations. The handle needs to be stored because the old | 755 // transferring navigations. The handle needs to be stored because the old |
785 // RenderFrameHost may be discarded before a new RenderFrameHost is created | 756 // RenderFrameHost may be discarded before a new RenderFrameHost is created |
786 // for the navigation. | 757 // for the navigation. |
787 // PlzNavigate: this will never be set since there are no transferring | 758 // PlzNavigate: this will never be set since there are no transferring |
788 // navigations in PlzNavigate. | 759 // navigations in PlzNavigate. |
789 scoped_ptr<NavigationHandleImpl> transfer_navigation_handle_; | 760 scoped_ptr<NavigationHandleImpl> transfer_navigation_handle_; |
790 | 761 |
791 // If either of these is non-NULL, the pending navigation is to a chrome: | |
792 // page. The scoped_ptr is used if pending_web_ui_ != web_ui_, the WeakPtr is | |
793 // used for when they reference the same object. If either is non-NULL, the | |
794 // other should be NULL. | |
795 // Note: These are not used in PlzNavigate. | |
796 scoped_ptr<WebUIImpl> pending_web_ui_; | |
797 base::WeakPtr<WebUIImpl> pending_and_current_web_ui_; | |
798 | |
799 class RenderFrameProxyHostMap; | 762 class RenderFrameProxyHostMap; |
800 scoped_ptr<RenderFrameProxyHostMap> proxy_hosts_; | 763 scoped_ptr<RenderFrameProxyHostMap> proxy_hosts_; |
801 | 764 |
802 // A list of RenderFrameHosts waiting to shut down after swapping out. We use | 765 // A list of RenderFrameHosts waiting to shut down after swapping out. We use |
803 // a linked list since we expect frequent deletes and no indexed access, and | 766 // a linked list since we expect frequent deletes and no indexed access, and |
804 // because sets don't appear to support linked_ptrs. | 767 // because sets don't appear to support linked_ptrs. |
805 typedef std::list<linked_ptr<RenderFrameHostImpl> > RFHPendingDeleteList; | 768 typedef std::list<linked_ptr<RenderFrameHostImpl> > RFHPendingDeleteList; |
806 RFHPendingDeleteList pending_delete_hosts_; | 769 RFHPendingDeleteList pending_delete_hosts_; |
807 | 770 |
808 // The intersitial page currently shown if any, not own by this class | 771 // The intersitial page currently shown if any, not own by this class |
809 // (the InterstitialPage is self-owned, it deletes itself when hidden). | 772 // (the InterstitialPage is self-owned, it deletes itself when hidden). |
810 InterstitialPageImpl* interstitial_page_; | 773 InterstitialPageImpl* interstitial_page_; |
811 | 774 |
812 // PlzNavigate | 775 // PlzNavigate |
813 // These members store a speculative RenderFrameHost and WebUI. They are | 776 // Stores a speculative RenderFrameHost which is created early in a navigation |
814 // created early in a navigation so a renderer process can be started in | 777 // so a renderer process can be started in parallel, if needed. |
815 // parallel, if needed. This is purely a performance optimization and is not | 778 // This is purely a performance optimization and is not required for correct |
816 // required for correct behavior. The created RenderFrameHost might be | 779 // behavior. The speculative RenderFrameHost might be discarded later on if |
817 // discarded later on if the final URL's SiteInstance isn't compatible with | 780 // the final URL's SiteInstance isn't compatible with the one used to create |
818 // what was used to create it. | 781 // it. |
819 // Note: PlzNavigate only uses speculative RenderFrameHost and WebUI, not | 782 // Note: PlzNavigate only uses the speculative RenderFrameHost, not the |
820 // the pending ones. | 783 // pending one. |
821 scoped_ptr<RenderFrameHostImpl> speculative_render_frame_host_; | 784 scoped_ptr<RenderFrameHostImpl> speculative_render_frame_host_; |
822 scoped_ptr<WebUIImpl> speculative_web_ui_; | |
823 | |
824 // PlzNavigate | |
825 // If true at navigation commit time the current WebUI will be kept instead of | |
826 // creating a new one. | |
827 bool should_reuse_web_ui_; | |
828 | 785 |
829 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 786 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
830 | 787 |
831 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 788 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
832 }; | 789 }; |
833 | 790 |
834 } // namespace content | 791 } // namespace content |
835 | 792 |
836 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 793 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |