Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: content/browser/web_contents/render_view_host_manager.h

Issue 11275062: Move content\browser\web_contents to content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_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 11 matching lines...) Expand all
22 class NavigationControllerImpl; 22 class NavigationControllerImpl;
23 class NavigationEntry; 23 class NavigationEntry;
24 class NavigationEntryImpl; 24 class NavigationEntryImpl;
25 class RenderViewHost; 25 class RenderViewHost;
26 class RenderViewHostImpl; 26 class RenderViewHostImpl;
27 class RenderViewHostManagerTest; 27 class RenderViewHostManagerTest;
28 class RenderWidgetHostDelegate; 28 class RenderWidgetHostDelegate;
29 class RenderWidgetHostView; 29 class RenderWidgetHostView;
30 class TestWebContents; 30 class TestWebContents;
31 class WebUIImpl; 31 class WebUIImpl;
32 }
33 32
34 // Manages RenderViewHosts for a WebContentsImpl. Normally there is only one and 33 // Manages RenderViewHosts for a WebContentsImpl. Normally there is only one and
35 // it is easy to do. But we can also have transitions of processes (and hence 34 // it is easy to do. But we can also have transitions of processes (and hence
36 // RenderViewHosts) that can get complex. 35 // RenderViewHosts) that can get complex.
37 class CONTENT_EXPORT RenderViewHostManager 36 class CONTENT_EXPORT RenderViewHostManager
38 : public content::RenderViewHostDelegate::RendererManagement, 37 : public RenderViewHostDelegate::RendererManagement,
39 public content::NotificationObserver { 38 public NotificationObserver {
40 public: 39 public:
41 // Functions implemented by our owner that we need. 40 // Functions implemented by our owner that we need.
42 // 41 //
43 // TODO(brettw) Clean this up! These are all the functions in WebContentsImpl 42 // TODO(brettw) Clean this up! These are all the functions in WebContentsImpl
44 // that are required to run this class. The design should probably be better 43 // that are required to run this class. The design should probably be better
45 // such that these are more clear. 44 // such that these are more clear.
46 // 45 //
47 // There is additional complexity that some of the functions we need in 46 // There is additional complexity that some of the functions we need in
48 // WebContentsImpl are inherited and non-virtual. These are named with 47 // WebContentsImpl are inherited and non-virtual. These are named with
49 // "RenderManager" so that the duplicate implementation of them will be clear. 48 // "RenderManager" so that the duplicate implementation of them will be clear.
50 class CONTENT_EXPORT Delegate { 49 class CONTENT_EXPORT Delegate {
51 public: 50 public:
52 // Initializes the given renderer if necessary and creates the view ID 51 // Initializes the given renderer if necessary and creates the view ID
53 // corresponding to this view host. If this method is not called and the 52 // corresponding to this view host. If this method is not called and the
54 // process is not shared, then the WebContentsImpl will act as though the 53 // process is not shared, then the WebContentsImpl will act as though the
55 // renderer is not running (i.e., it will render "sad tab"). This method is 54 // renderer is not running (i.e., it will render "sad tab"). This method is
56 // automatically called from LoadURL. 55 // automatically called from LoadURL.
57 // 56 //
58 // If you are attaching to an already-existing RenderView, you should call 57 // If you are attaching to an already-existing RenderView, you should call
59 // InitWithExistingID. 58 // InitWithExistingID.
60 virtual bool CreateRenderViewForRenderManager( 59 virtual bool CreateRenderViewForRenderManager(
61 content::RenderViewHost* render_view_host, int opener_route_id) = 0; 60 RenderViewHost* render_view_host, int opener_route_id) = 0;
62 virtual void BeforeUnloadFiredFromRenderManager( 61 virtual void BeforeUnloadFiredFromRenderManager(
63 bool proceed, const base::TimeTicks& proceed_time, 62 bool proceed, const base::TimeTicks& proceed_time,
64 bool* proceed_to_fire_unload) = 0; 63 bool* proceed_to_fire_unload) = 0;
65 virtual void RenderViewGoneFromRenderManager( 64 virtual void RenderViewGoneFromRenderManager(
66 content::RenderViewHost* render_view_host) = 0; 65 RenderViewHost* render_view_host) = 0;
67 virtual void UpdateRenderViewSizeForRenderManager() = 0; 66 virtual void UpdateRenderViewSizeForRenderManager() = 0;
68 virtual void NotifySwappedFromRenderManager() = 0; 67 virtual void NotifySwappedFromRenderManager() = 0;
69 virtual content::NavigationControllerImpl& 68 virtual NavigationControllerImpl&
70 GetControllerForRenderManager() = 0; 69 GetControllerForRenderManager() = 0;
71 70
72 // Create swapped out RenderViews in the given SiteInstance for each tab in 71 // Create swapped out RenderViews in the given SiteInstance for each tab in
73 // the opener chain of this tab, if any. This allows the current tab to 72 // the opener chain of this tab, if any. This allows the current tab to
74 // make cross-process script calls to its opener(s). Returns the route ID 73 // make cross-process script calls to its opener(s). Returns the route ID
75 // of the immediate opener, if one exists (otherwise MSG_ROUTING_NONE). 74 // of the immediate opener, if one exists (otherwise MSG_ROUTING_NONE).
76 virtual int CreateOpenerRenderViewsForRenderManager( 75 virtual int CreateOpenerRenderViewsForRenderManager(
77 content::SiteInstance* instance) = 0; 76 SiteInstance* instance) = 0;
78 77
79 // Creates a WebUI object for the given URL if one applies. Ownership of the 78 // Creates a WebUI object for the given URL if one applies. Ownership of the
80 // returned pointer will be passed to the caller. If no WebUI applies, 79 // returned pointer will be passed to the caller. If no WebUI applies,
81 // returns NULL. 80 // returns NULL.
82 virtual content::WebUIImpl* CreateWebUIForRenderManager( 81 virtual WebUIImpl* CreateWebUIForRenderManager(const GURL& url) = 0;
83 const GURL& url) = 0;
84 82
85 // Returns the navigation entry of the current navigation, or NULL if there 83 // Returns the navigation entry of the current navigation, or NULL if there
86 // is none. 84 // is none.
87 virtual content::NavigationEntry* 85 virtual NavigationEntry*
88 GetLastCommittedNavigationEntryForRenderManager() = 0; 86 GetLastCommittedNavigationEntryForRenderManager() = 0;
89 87
90 // Returns true if the location bar should be focused by default rather than 88 // Returns true if the location bar should be focused by default rather than
91 // the page contents. The view calls this function when the tab is focused 89 // the page contents. The view calls this function when the tab is focused
92 // to see what it should do. 90 // to see what it should do.
93 virtual bool FocusLocationBarByDefault() = 0; 91 virtual bool FocusLocationBarByDefault() = 0;
94 92
95 // Focuses the location bar. 93 // Focuses the location bar.
96 virtual void SetFocusToLocationBar(bool select_all) = 0; 94 virtual void SetFocusToLocationBar(bool select_all) = 0;
97 95
98 // Creates a view and sets the size for the specified RVH. 96 // Creates a view and sets the size for the specified RVH.
99 virtual void CreateViewAndSetSizeForRVH(content::RenderViewHost* rvh) = 0; 97 virtual void CreateViewAndSetSizeForRVH(RenderViewHost* rvh) = 0;
100 98
101 protected: 99 protected:
102 virtual ~Delegate() {} 100 virtual ~Delegate() {}
103 }; 101 };
104 102
105 // All three delegate pointers must be non-NULL and are not owned by this 103 // All three delegate pointers must be non-NULL and are not owned by this
106 // class. They must outlive this class. The RenderViewHostDelegate and 104 // class. They must outlive this class. The RenderViewHostDelegate and
107 // RenderWidgetHostDelegate are what will be installed into all 105 // RenderWidgetHostDelegate are what will be installed into all
108 // RenderViewHosts that are created. 106 // RenderViewHosts that are created.
109 // 107 //
110 // You must call Init() before using this class. 108 // You must call Init() before using this class.
111 RenderViewHostManager( 109 RenderViewHostManager(
112 content::RenderViewHostDelegate* render_view_delegate, 110 RenderViewHostDelegate* render_view_delegate,
113 content::RenderWidgetHostDelegate* render_widget_delegate, 111 RenderWidgetHostDelegate* render_widget_delegate,
114 Delegate* delegate); 112 Delegate* delegate);
115 virtual ~RenderViewHostManager(); 113 virtual ~RenderViewHostManager();
116 114
117 // For arguments, see WebContentsImpl constructor. 115 // For arguments, see WebContentsImpl constructor.
118 void Init(content::BrowserContext* browser_context, 116 void Init(BrowserContext* browser_context,
119 content::SiteInstance* site_instance, 117 SiteInstance* site_instance,
120 int routing_id); 118 int routing_id);
121 119
122 // Returns the currently active RenderViewHost. 120 // Returns the currently active RenderViewHost.
123 // 121 //
124 // This will be non-NULL between Init() and Shutdown(). You may want to NULL 122 // This will be non-NULL between Init() and Shutdown(). You may want to NULL
125 // check it in many cases, however. Windows can send us messages during the 123 // check it in many cases, however. Windows can send us messages during the
126 // destruction process after it has been shut down. 124 // destruction process after it has been shut down.
127 content::RenderViewHostImpl* current_host() const; 125 RenderViewHostImpl* current_host() const;
128 126
129 // Returns the view associated with the current RenderViewHost, or NULL if 127 // Returns the view associated with the current RenderViewHost, or NULL if
130 // there is no current one. 128 // there is no current one.
131 content::RenderWidgetHostView* GetRenderWidgetHostView() const; 129 RenderWidgetHostView* GetRenderWidgetHostView() const;
132 130
133 // Returns the pending render view host, or NULL if there is no pending one. 131 // Returns the pending render view host, or NULL if there is no pending one.
134 content::RenderViewHostImpl* pending_render_view_host() const; 132 RenderViewHostImpl* pending_render_view_host() const;
135 133
136 // Returns the current committed Web UI or NULL if none applies. 134 // Returns the current committed Web UI or NULL if none applies.
137 content::WebUIImpl* web_ui() const { return web_ui_.get(); } 135 WebUIImpl* web_ui() const { return web_ui_.get(); }
138 136
139 // Returns the Web UI for the pending navigation, or NULL of none applies. 137 // Returns the Web UI for the pending navigation, or NULL of none applies.
140 content::WebUIImpl* pending_web_ui() const { 138 WebUIImpl* pending_web_ui() const {
141 return pending_web_ui_.get() ? pending_web_ui_.get() : 139 return pending_web_ui_.get() ? pending_web_ui_.get() :
142 pending_and_current_web_ui_.get(); 140 pending_and_current_web_ui_.get();
143 } 141 }
144 142
145 // Called when we want to instruct the renderer to navigate to the given 143 // Called when we want to instruct the renderer to navigate to the given
146 // navigation entry. It may create a new RenderViewHost or re-use an existing 144 // navigation entry. It may create a new RenderViewHost or re-use an existing
147 // one. The RenderViewHost to navigate will be returned. Returns NULL if one 145 // one. The RenderViewHost to navigate will be returned. Returns NULL if one
148 // could not be created. 146 // could not be created.
149 content::RenderViewHostImpl* Navigate( 147 RenderViewHostImpl* Navigate(const NavigationEntryImpl& entry);
150 const content::NavigationEntryImpl& entry);
151 148
152 // Instructs the various live views to stop. Called when the user directed the 149 // Instructs the various live views to stop. Called when the user directed the
153 // page to stop loading. 150 // page to stop loading.
154 void Stop(); 151 void Stop();
155 152
156 // Notifies the regular and pending RenderViewHosts that a load is or is not 153 // Notifies the regular and pending RenderViewHosts that a load is or is not
157 // happening. Even though the message is only for one of them, we don't know 154 // happening. Even though the message is only for one of them, we don't know
158 // which one so we tell both. 155 // which one so we tell both.
159 void SetIsLoading(bool is_loading); 156 void SetIsLoading(bool is_loading);
160 157
161 // Whether to close the tab or not when there is a hang during an unload 158 // Whether to close the tab or not when there is a hang during an unload
162 // handler. If we are mid-crosssite navigation, then we should proceed 159 // handler. If we are mid-crosssite navigation, then we should proceed
163 // with the navigation instead of closing the tab. 160 // with the navigation instead of closing the tab.
164 bool ShouldCloseTabOnUnresponsiveRenderer(); 161 bool ShouldCloseTabOnUnresponsiveRenderer();
165 162
166 // Called when a renderer's main frame navigates. 163 // Called when a renderer's main frame navigates.
167 void DidNavigateMainFrame(content::RenderViewHost* render_view_host); 164 void DidNavigateMainFrame(RenderViewHost* render_view_host);
168 165
169 // Called when a renderer has navigated and when its frame tree is updated. 166 // Called when a renderer has navigated and when its frame tree is updated.
170 void DidUpdateFrameTree(content::RenderViewHost* render_view_host); 167 void DidUpdateFrameTree(RenderViewHost* render_view_host);
171 168
172 // Helper method to create a RenderViewHost. If |swapped_out| is true, it 169 // Helper method to create a RenderViewHost. If |swapped_out| is true, it
173 // will be initially placed on the swapped out hosts list. Otherwise, it 170 // will be initially placed on the swapped out hosts list. Otherwise, it
174 // will be used for a pending cross-site navigation. 171 // will be used for a pending cross-site navigation.
175 int CreateRenderView(content::SiteInstance* instance, 172 int CreateRenderView(SiteInstance* instance,
176 int opener_route_id, 173 int opener_route_id,
177 bool swapped_out); 174 bool swapped_out);
178 175
179 // Set the WebUI after committing a page load. This is useful for navigations 176 // Set the WebUI after committing a page load. This is useful for navigations
180 // initiated from a renderer, where we want to give the new renderer WebUI 177 // initiated from a renderer, where we want to give the new renderer WebUI
181 // privileges from the originating renderer. 178 // privileges from the originating renderer.
182 void SetWebUIPostCommit(content::WebUIImpl* web_ui); 179 void SetWebUIPostCommit(WebUIImpl* web_ui);
183 180
184 // Called when a provisional load on the given renderer is aborted. 181 // Called when a provisional load on the given renderer is aborted.
185 void RendererAbortedProvisionalLoad( 182 void RendererAbortedProvisionalLoad(RenderViewHost* render_view_host);
186 content::RenderViewHost* render_view_host);
187 183
188 // Sets the passed passed interstitial as the currently showing interstitial. 184 // Sets the passed passed interstitial as the currently showing interstitial.
189 // |interstitial_page| should be non NULL (use the remove_interstitial_page 185 // |interstitial_page| should be non NULL (use the remove_interstitial_page
190 // method to unset the interstitial) and no interstitial page should be set 186 // method to unset the interstitial) and no interstitial page should be set
191 // when there is already a non NULL interstitial page set. 187 // when there is already a non NULL interstitial page set.
192 void set_interstitial_page(content::InterstitialPageImpl* interstitial_page) { 188 void set_interstitial_page(InterstitialPageImpl* interstitial_page) {
193 DCHECK(!interstitial_page_ && interstitial_page); 189 DCHECK(!interstitial_page_ && interstitial_page);
194 interstitial_page_ = interstitial_page; 190 interstitial_page_ = interstitial_page;
195 } 191 }
196 192
197 // Unsets the currently showing interstitial. 193 // Unsets the currently showing interstitial.
198 void remove_interstitial_page() { 194 void remove_interstitial_page() {
199 DCHECK(interstitial_page_); 195 DCHECK(interstitial_page_);
200 interstitial_page_ = NULL; 196 interstitial_page_ = NULL;
201 } 197 }
202 198
203 // Returns the currently showing interstitial, NULL if no interstitial is 199 // Returns the currently showing interstitial, NULL if no interstitial is
204 // showing. 200 // showing.
205 content::InterstitialPageImpl* interstitial_page() const { 201 InterstitialPageImpl* interstitial_page() const { return interstitial_page_; }
206 return interstitial_page_;
207 }
208 202
209 // RenderViewHostDelegate::RendererManagement implementation. 203 // RenderViewHostDelegate::RendererManagement implementation.
210 virtual void ShouldClosePage( 204 virtual void ShouldClosePage(
211 bool for_cross_site_transition, 205 bool for_cross_site_transition,
212 bool proceed, 206 bool proceed,
213 const base::TimeTicks& proceed_time) OVERRIDE; 207 const base::TimeTicks& proceed_time) OVERRIDE;
214 virtual void OnCrossSiteResponse(int new_render_process_host_id, 208 virtual void OnCrossSiteResponse(int new_render_process_host_id,
215 int new_request_id) OVERRIDE; 209 int new_request_id) OVERRIDE;
216 210
217 // content::NotificationObserver implementation. 211 // NotificationObserver implementation.
218 virtual void Observe(int type, 212 virtual void Observe(int type,
219 const content::NotificationSource& source, 213 const NotificationSource& source,
220 const content::NotificationDetails& details) OVERRIDE; 214 const NotificationDetails& details) OVERRIDE;
221 215
222 // Called when a RenderViewHost is about to be deleted. 216 // Called when a RenderViewHost is about to be deleted.
223 void RenderViewDeleted(content::RenderViewHost* rvh); 217 void RenderViewDeleted(RenderViewHost* rvh);
224 218
225 // Returns whether the given RenderViewHost is on the list of swapped out 219 // Returns whether the given RenderViewHost is on the list of swapped out
226 // RenderViewHosts. 220 // RenderViewHosts.
227 bool IsSwappedOut(content::RenderViewHost* rvh); 221 bool IsSwappedOut(RenderViewHost* rvh);
228 222
229 // Returns the swapped out RenderViewHost for the given SiteInstance, if any. 223 // Returns the swapped out RenderViewHost for the given SiteInstance, if any.
230 content::RenderViewHostImpl* GetSwappedOutRenderViewHost( 224 RenderViewHostImpl* GetSwappedOutRenderViewHost(SiteInstance* instance);
231 content::SiteInstance* instance);
232 225
233 private: 226 private:
234 friend class content::RenderViewHostManagerTest; 227 friend class RenderViewHostManagerTest;
235 friend class content::TestWebContents; 228 friend class TestWebContents;
236 229
237 // Returns whether this tab should transition to a new renderer for 230 // Returns whether this tab should transition to a new renderer for
238 // cross-site URLs. Enabled unless we see the --process-per-tab command line 231 // cross-site URLs. Enabled unless we see the --process-per-tab command line
239 // switch. Can be overridden in unit tests. 232 // switch. Can be overridden in unit tests.
240 bool ShouldTransitionCrossSite(); 233 bool ShouldTransitionCrossSite();
241 234
242 // Returns true if the two navigation entries are incompatible in some way 235 // Returns true if the two navigation entries are incompatible in some way
243 // other than site instances. Cases where this can happen include Web UI 236 // other than site instances. Cases where this can happen include Web UI
244 // to regular web pages. It will cause us to swap RenderViewHosts (and hence 237 // to regular web pages. It will cause us to swap RenderViewHosts (and hence
245 // RenderProcessHosts) even if the site instance would otherwise be the same. 238 // RenderProcessHosts) even if the site instance would otherwise be the same.
246 // As part of this, we'll also force new SiteInstances and BrowsingInstances. 239 // As part of this, we'll also force new SiteInstances and BrowsingInstances.
247 // Either of the entries may be NULL. 240 // Either of the entries may be NULL.
248 bool ShouldSwapProcessesForNavigation( 241 bool ShouldSwapProcessesForNavigation(
249 const content::NavigationEntry* curr_entry, 242 const NavigationEntry* curr_entry,
250 const content::NavigationEntryImpl* new_entry) const; 243 const NavigationEntryImpl* new_entry) const;
251 244
252 bool ShouldReuseWebUI( 245 bool ShouldReuseWebUI(
253 const content::NavigationEntry* curr_entry, 246 const NavigationEntry* curr_entry,
254 const content::NavigationEntryImpl* new_entry) const; 247 const NavigationEntryImpl* new_entry) const;
255 248
256 // Returns an appropriate SiteInstance object for the given NavigationEntry, 249 // Returns an appropriate SiteInstance object for the given NavigationEntry,
257 // possibly reusing the current SiteInstance. 250 // possibly reusing the current SiteInstance.
258 // Never called if --process-per-tab is used. 251 // Never called if --process-per-tab is used.
259 content::SiteInstance* GetSiteInstanceForEntry( 252 SiteInstance* GetSiteInstanceForEntry(
260 const content::NavigationEntryImpl& entry, 253 const NavigationEntryImpl& entry,
261 content::SiteInstance* curr_instance); 254 SiteInstance* curr_instance);
262 255
263 // Sets up the necessary state for a new RenderViewHost with the given opener. 256 // Sets up the necessary state for a new RenderViewHost with the given opener.
264 bool InitRenderView(content::RenderViewHost* render_view_host, 257 bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id);
265 int opener_route_id);
266 258
267 // Sets the pending RenderViewHost/WebUI to be the active one. Note that this 259 // Sets the pending RenderViewHost/WebUI to be the active one. Note that this
268 // doesn't require the pending render_view_host_ pointer to be non-NULL, since 260 // doesn't require the pending render_view_host_ pointer to be non-NULL, since
269 // there could be Web UI switching as well. Call this for every commit. 261 // there could be Web UI switching as well. Call this for every commit.
270 void CommitPending(); 262 void CommitPending();
271 263
272 // Helper method to terminate the pending RenderViewHost. 264 // Helper method to terminate the pending RenderViewHost.
273 void CancelPending(); 265 void CancelPending();
274 266
275 content::RenderViewHostImpl* UpdateRendererStateForNavigate( 267 RenderViewHostImpl* UpdateRendererStateForNavigate(
276 const content::NavigationEntryImpl& entry); 268 const NavigationEntryImpl& entry);
277 269
278 // Called when a renderer process is starting to close. We should not 270 // Called when a renderer process is starting to close. We should not
279 // schedule new navigations in its swapped out RenderViewHosts after this. 271 // schedule new navigations in its swapped out RenderViewHosts after this.
280 void RendererProcessClosing(content::RenderProcessHost* render_process_host); 272 void RendererProcessClosing(RenderProcessHost* render_process_host);
281 273
282 // Our delegate, not owned by us. Guaranteed non-NULL. 274 // Our delegate, not owned by us. Guaranteed non-NULL.
283 Delegate* delegate_; 275 Delegate* delegate_;
284 276
285 // Whether a navigation requiring different RenderView's is pending. This is 277 // Whether a navigation requiring different RenderView's is pending. This is
286 // either cross-site request is (in the new process model), or when required 278 // either cross-site request is (in the new process model), or when required
287 // for the view type (like view source versus not). 279 // for the view type (like view source versus not).
288 bool cross_navigation_pending_; 280 bool cross_navigation_pending_;
289 281
290 // Implemented by the owner of this class, these delegates are installed into 282 // Implemented by the owner of this class, these delegates are installed into
291 // all the RenderViewHosts that we create. 283 // all the RenderViewHosts that we create.
292 content::RenderViewHostDelegate* render_view_delegate_; 284 RenderViewHostDelegate* render_view_delegate_;
293 content::RenderWidgetHostDelegate* render_widget_delegate_; 285 RenderWidgetHostDelegate* render_widget_delegate_;
294 286
295 // Our RenderView host and its associated Web UI (if any, will be NULL for 287 // Our RenderView host and its associated Web UI (if any, will be NULL for
296 // non-DOM-UI pages). This object is responsible for all communication with 288 // non-DOM-UI pages). This object is responsible for all communication with
297 // a child RenderView instance. 289 // a child RenderView instance.
298 content::RenderViewHostImpl* render_view_host_; 290 RenderViewHostImpl* render_view_host_;
299 scoped_ptr<content::WebUIImpl> web_ui_; 291 scoped_ptr<WebUIImpl> web_ui_;
300 292
301 // A RenderViewHost used to load a cross-site page. This remains hidden 293 // A RenderViewHost used to load a cross-site page. This remains hidden
302 // while a cross-site request is pending until it calls DidNavigate. It may 294 // while a cross-site request is pending until it calls DidNavigate. It may
303 // have an associated Web UI, in which case the Web UI pointer will be non- 295 // have an associated Web UI, in which case the Web UI pointer will be non-
304 // NULL. 296 // NULL.
305 // 297 //
306 // The |pending_web_ui_| may be non-NULL even when the 298 // The |pending_web_ui_| may be non-NULL even when the
307 // |pending_render_view_host_| is NULL. This will happen when we're 299 // |pending_render_view_host_| is NULL. This will happen when we're
308 // transitioning between two Web UI pages: the RVH won't be swapped, so the 300 // transitioning between two Web UI pages: the RVH won't be swapped, so the
309 // pending pointer will be unused, but there will be a pending Web UI 301 // pending pointer will be unused, but there will be a pending Web UI
310 // associated with the navigation. 302 // associated with the navigation.
311 content::RenderViewHostImpl* pending_render_view_host_; 303 RenderViewHostImpl* pending_render_view_host_;
312 304
313 // If either of these is non-NULL, the pending navigation is to a chrome: 305 // If either of these is non-NULL, the pending navigation is to a chrome:
314 // page. The scoped_ptr is used if pending_web_ui_ != web_ui_, the WeakPtr is 306 // page. The scoped_ptr is used if pending_web_ui_ != web_ui_, the WeakPtr is
315 // used for when they reference the same object. If either is non-NULL, the 307 // used for when they reference the same object. If either is non-NULL, the
316 // other should be NULL. 308 // other should be NULL.
317 scoped_ptr<content::WebUIImpl> pending_web_ui_; 309 scoped_ptr<WebUIImpl> pending_web_ui_;
318 base::WeakPtr<content::WebUIImpl> pending_and_current_web_ui_; 310 base::WeakPtr<WebUIImpl> pending_and_current_web_ui_;
319 311
320 // A map of site instance ID to swapped out RenderViewHosts. 312 // A map of site instance ID to swapped out RenderViewHosts.
321 typedef base::hash_map<int32, content::RenderViewHostImpl*> RenderViewHostMap; 313 typedef base::hash_map<int32, RenderViewHostImpl*> RenderViewHostMap;
322 RenderViewHostMap swapped_out_hosts_; 314 RenderViewHostMap swapped_out_hosts_;
323 315
324 // The intersitial page currently shown if any, not own by this class 316 // The intersitial page currently shown if any, not own by this class
325 // (the InterstitialPage is self-owned, it deletes itself when hidden). 317 // (the InterstitialPage is self-owned, it deletes itself when hidden).
326 content::InterstitialPageImpl* interstitial_page_; 318 InterstitialPageImpl* interstitial_page_;
327 319
328 content::NotificationRegistrar registrar_; 320 NotificationRegistrar registrar_;
329 321
330 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager); 322 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager);
331 }; 323 };
332 324
325 } // namespace content
326
333 #endif // CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_ 327 #endif // CONTENT_BROWSER_WEB_CONTENTS_RENDER_VIEW_HOST_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/navigation_entry_impl.cc ('k') | content/browser/web_contents/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698