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 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // Functions and parameters whose description are prefixed by PlzNavigate are | 109 // Functions and parameters whose description are prefixed by PlzNavigate are |
110 // part of a navigation refactoring project, currently behind the | 110 // part of a navigation refactoring project, currently behind the |
111 // enable-browser-side-navigation flag. The idea is to move the logic behind | 111 // enable-browser-side-navigation flag. The idea is to move the logic behind |
112 // driving navigations from the renderer to the browser. | 112 // driving navigations from the renderer to the browser. |
113 class CONTENT_EXPORT Delegate { | 113 class CONTENT_EXPORT Delegate { |
114 public: | 114 public: |
115 // Initializes the given renderer if necessary and creates the view ID | 115 // Initializes the given renderer if necessary and creates the view ID |
116 // corresponding to this view host. If this method is not called and the | 116 // corresponding to this view host. If this method is not called and the |
117 // process is not shared, then the WebContentsImpl will act as though the | 117 // process is not shared, then the WebContentsImpl will act as though the |
118 // renderer is not running (i.e., it will render "sad tab"). This method is | 118 // renderer is not running (i.e., it will render "sad tab"). This method is |
119 // automatically called from LoadURL. |for_main_frame_navigation| indicates | 119 // automatically called from LoadURL. |
120 // whether this RenderViewHost is used to render a top-level frame, so the | |
121 // appropriate RenderWidgetHostView type is used. | |
122 virtual bool CreateRenderViewForRenderManager( | 120 virtual bool CreateRenderViewForRenderManager( |
123 RenderViewHost* render_view_host, | 121 RenderViewHost* render_view_host, |
124 int opener_frame_routing_id, | 122 int opener_frame_routing_id, |
125 int proxy_routing_id, | 123 int proxy_routing_id, |
126 const FrameReplicationState& replicated_frame_state, | 124 const FrameReplicationState& replicated_frame_state) = 0; |
127 bool for_main_frame_navigation) = 0; | 125 virtual void CreateRenderWidgetHostViewForRenderManager( |
| 126 RenderViewHost* render_view_host) = 0; |
128 virtual bool CreateRenderFrameForRenderManager( | 127 virtual bool CreateRenderFrameForRenderManager( |
129 RenderFrameHost* render_frame_host, | 128 RenderFrameHost* render_frame_host, |
130 int parent_routing_id, | 129 int parent_routing_id, |
131 int previous_sibling_routing_id, | 130 int previous_sibling_routing_id, |
132 int proxy_routing_id) = 0; | 131 int proxy_routing_id) = 0; |
133 virtual void BeforeUnloadFiredFromRenderManager( | 132 virtual void BeforeUnloadFiredFromRenderManager( |
134 bool proceed, const base::TimeTicks& proceed_time, | 133 bool proceed, const base::TimeTicks& proceed_time, |
135 bool* proceed_to_fire_unload) = 0; | 134 bool* proceed_to_fire_unload) = 0; |
136 virtual void RenderProcessGoneFromRenderManager( | 135 virtual void RenderProcessGoneFromRenderManager( |
137 RenderViewHost* render_view_host) = 0; | 136 RenderViewHost* render_view_host) = 0; |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 // Determines the appropriate url to use as the current url for SiteInstance | 599 // Determines the appropriate url to use as the current url for SiteInstance |
601 // selection. | 600 // selection. |
602 const GURL& GetCurrentURLForSiteInstance( | 601 const GURL& GetCurrentURLForSiteInstance( |
603 SiteInstance* current_instance, | 602 SiteInstance* current_instance, |
604 NavigationEntry* current_entry); | 603 NavigationEntry* current_entry); |
605 | 604 |
606 // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to | 605 // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to |
607 // |pending_render_frame_host_| while respecting the opener route if needed | 606 // |pending_render_frame_host_| while respecting the opener route if needed |
608 // and stores it in pending_render_frame_host_. | 607 // and stores it in pending_render_frame_host_. |
609 void CreatePendingRenderFrameHost(SiteInstance* old_instance, | 608 void CreatePendingRenderFrameHost(SiteInstance* old_instance, |
610 SiteInstance* new_instance, | 609 SiteInstance* new_instance); |
611 bool is_main_frame); | |
612 | 610 |
613 // Ensure that we have created all needed proxies for a new RFH with | 611 // Ensure that we have created all needed proxies for a new RFH with |
614 // SiteInstance |new_instance|: (1) create swapped-out RVHs and proxies for | 612 // SiteInstance |new_instance|: (1) create swapped-out RVHs and proxies for |
615 // the new RFH's opener chain if we are staying in the same BrowsingInstance; | 613 // the new RFH's opener chain if we are staying in the same BrowsingInstance; |
616 // (2) Create proxies for the new RFH's SiteInstance in its own frame tree. | 614 // (2) Create proxies for the new RFH's SiteInstance in its own frame tree. |
617 void CreateProxiesForNewRenderFrameHost(SiteInstance* old_instance, | 615 void CreateProxiesForNewRenderFrameHost(SiteInstance* old_instance, |
618 SiteInstance* new_instance); | 616 SiteInstance* new_instance); |
619 | 617 |
620 // Create swapped out RenderViews and RenderFrameProxies in the given | 618 // Create swapped out RenderViews and RenderFrameProxies in the given |
621 // SiteInstance for all frames on the opener chain of this frame. Same as | 619 // SiteInstance for all frames on the opener chain of this frame. Same as |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 SiteInstance* old_instance, | 655 SiteInstance* old_instance, |
658 SiteInstance* new_instance, | 656 SiteInstance* new_instance, |
659 int bindings); | 657 int bindings); |
660 | 658 |
661 // Sets up the necessary state for a new RenderViewHost. Creates a | 659 // Sets up the necessary state for a new RenderViewHost. Creates a |
662 // RenderFrameProxy in the target renderer process with the given | 660 // RenderFrameProxy in the target renderer process with the given |
663 // |proxy_routing_id|, which is used to route IPC messages when in swapped | 661 // |proxy_routing_id|, which is used to route IPC messages when in swapped |
664 // out state. Returns early if the RenderViewHost has already been | 662 // out state. Returns early if the RenderViewHost has already been |
665 // initialized for another RenderFrameHost. | 663 // initialized for another RenderFrameHost. |
666 bool InitRenderView(RenderViewHostImpl* render_view_host, | 664 bool InitRenderView(RenderViewHostImpl* render_view_host, |
667 int proxy_routing_id, | 665 int proxy_routing_id); |
668 bool for_main_frame_navigation); | |
669 | 666 |
670 // Initialization for RenderFrameHost uses the same sequence as InitRenderView | 667 // Initialization for RenderFrameHost uses the same sequence as InitRenderView |
671 // above. | 668 // above. |
672 bool InitRenderFrame(RenderFrameHostImpl* render_frame_host); | 669 bool InitRenderFrame(RenderFrameHostImpl* render_frame_host); |
673 | 670 |
674 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this | 671 // Sets the pending RenderFrameHost/WebUI to be the active one. Note that this |
675 // doesn't require the pending render_frame_host_ pointer to be non-NULL, | 672 // doesn't require the pending render_frame_host_ pointer to be non-NULL, |
676 // since there could be Web UI switching as well. Call this for every commit. | 673 // since there could be Web UI switching as well. Call this for every commit. |
677 // If PlzNavigate is enabled the method will set the speculative (not pending) | 674 // If PlzNavigate is enabled the method will set the speculative (not pending) |
678 // RenderFrameHost to be the active one. | 675 // RenderFrameHost to be the active one. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 bool should_reuse_web_ui_; | 815 bool should_reuse_web_ui_; |
819 | 816 |
820 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 817 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
821 | 818 |
822 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 819 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
823 }; | 820 }; |
824 | 821 |
825 } // namespace content | 822 } // namespace content |
826 | 823 |
827 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 824 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
OLD | NEW |