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 <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 bool CreateRenderWidgetHostViewForRenderManager( |
|
Charlie Reis
2015/08/31 19:02:51
I still think we really need comments here. It's
lfg
2015/09/02 00:32:16
I removed the parameter and simplified the functio
| |
| 126 RenderViewHost* render_view_host, | |
| 127 bool main_frame_is_proxy) = 0; | |
| 128 virtual bool CreateRenderFrameForRenderManager( | 128 virtual bool CreateRenderFrameForRenderManager( |
| 129 RenderFrameHost* render_frame_host, | 129 RenderFrameHost* render_frame_host, |
| 130 int parent_routing_id, | 130 int parent_routing_id, |
| 131 int previous_sibling_routing_id, | 131 int previous_sibling_routing_id, |
| 132 int proxy_routing_id) = 0; | 132 int proxy_routing_id) = 0; |
| 133 virtual void BeforeUnloadFiredFromRenderManager( | 133 virtual void BeforeUnloadFiredFromRenderManager( |
| 134 bool proceed, const base::TimeTicks& proceed_time, | 134 bool proceed, const base::TimeTicks& proceed_time, |
| 135 bool* proceed_to_fire_unload) = 0; | 135 bool* proceed_to_fire_unload) = 0; |
| 136 virtual void RenderProcessGoneFromRenderManager( | 136 virtual void RenderProcessGoneFromRenderManager( |
| 137 RenderViewHost* render_view_host) = 0; | 137 RenderViewHost* render_view_host) = 0; |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 598 // Determines the appropriate url to use as the current url for SiteInstance | 598 // Determines the appropriate url to use as the current url for SiteInstance |
| 599 // selection. | 599 // selection. |
| 600 const GURL& GetCurrentURLForSiteInstance( | 600 const GURL& GetCurrentURLForSiteInstance( |
| 601 SiteInstance* current_instance, | 601 SiteInstance* current_instance, |
| 602 NavigationEntry* current_entry); | 602 NavigationEntry* current_entry); |
| 603 | 603 |
| 604 // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to | 604 // Creates a new RenderFrameHostImpl for the |new_instance| and assign it to |
| 605 // |pending_render_frame_host_| while respecting the opener route if needed | 605 // |pending_render_frame_host_| while respecting the opener route if needed |
| 606 // and stores it in pending_render_frame_host_. | 606 // and stores it in pending_render_frame_host_. |
| 607 void CreatePendingRenderFrameHost(SiteInstance* old_instance, | 607 void CreatePendingRenderFrameHost(SiteInstance* old_instance, |
| 608 SiteInstance* new_instance, | 608 SiteInstance* new_instance); |
| 609 bool is_main_frame); | |
| 610 | 609 |
| 611 // Ensure that we have created all needed proxies for a new RFH with | 610 // Ensure that we have created all needed proxies for a new RFH with |
| 612 // SiteInstance |new_instance|: (1) create swapped-out RVHs and proxies for | 611 // SiteInstance |new_instance|: (1) create swapped-out RVHs and proxies for |
| 613 // the new RFH's opener chain if we are staying in the same BrowsingInstance; | 612 // the new RFH's opener chain if we are staying in the same BrowsingInstance; |
| 614 // (2) Create proxies for the new RFH's SiteInstance in its own frame tree; | 613 // (2) Create proxies for the new RFH's SiteInstance in its own frame tree; |
| 615 // (3) set any additional flags for the new RenderFrame with | 614 // (3) set any additional flags for the new RenderFrame with |
| 616 // |create_render_frame_flags|. | 615 // |create_render_frame_flags|. |
| 617 void CreateProxiesForNewRenderFrameHost(SiteInstance* old_instance, | 616 void CreateProxiesForNewRenderFrameHost(SiteInstance* old_instance, |
| 618 SiteInstance* new_instance, | 617 SiteInstance* new_instance, |
| 619 int* create_render_frame_flags); | 618 int* create_render_frame_flags); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 SiteInstance* old_instance, | 655 SiteInstance* old_instance, |
| 657 SiteInstance* new_instance, | 656 SiteInstance* new_instance, |
| 658 int bindings); | 657 int bindings); |
| 659 | 658 |
| 660 // Sets up the necessary state for a new RenderViewHost. Creates a | 659 // Sets up the necessary state for a new RenderViewHost. Creates a |
| 661 // RenderFrameProxy in the target renderer process with the given | 660 // RenderFrameProxy in the target renderer process with the given |
| 662 // |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 |
| 663 // out state. Returns early if the RenderViewHost has already been | 662 // out state. Returns early if the RenderViewHost has already been |
| 664 // initialized for another RenderFrameHost. | 663 // initialized for another RenderFrameHost. |
| 665 bool InitRenderView(RenderViewHostImpl* render_view_host, | 664 bool InitRenderView(RenderViewHostImpl* render_view_host, |
| 666 int proxy_routing_id, | 665 int proxy_routing_id); |
| 667 bool for_main_frame_navigation); | |
| 668 | 666 |
| 669 // Initialization for RenderFrameHost uses the same sequence as InitRenderView | 667 // Initialization for RenderFrameHost uses the same sequence as InitRenderView |
| 670 // above. | 668 // above. |
| 671 bool InitRenderFrame(RenderFrameHostImpl* render_frame_host); | 669 bool InitRenderFrame(RenderFrameHostImpl* render_frame_host); |
| 672 | 670 |
| 673 // 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 |
| 674 // 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, |
| 675 // 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. |
| 676 // 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) |
| 677 // 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... | |
| 817 bool should_reuse_web_ui_; | 815 bool should_reuse_web_ui_; |
| 818 | 816 |
| 819 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 817 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 820 | 818 |
| 821 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 819 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 822 }; | 820 }; |
| 823 | 821 |
| 824 } // namespace content | 822 } // namespace content |
| 825 | 823 |
| 826 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 824 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |