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_VIEW_HOST_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_VIEW_HOST_MANAGER_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_VIEW_HOST_MANAGER_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // If |is_transfer|, this is whether the navigation should replace the | 292 // If |is_transfer|, this is whether the navigation should replace the |
293 // current history entry. | 293 // current history entry. |
294 bool should_replace_current_entry; | 294 bool should_replace_current_entry; |
295 }; | 295 }; |
296 | 296 |
297 // Returns whether this tab should transition to a new renderer for | 297 // Returns whether this tab should transition to a new renderer for |
298 // cross-site URLs. Enabled unless we see the --process-per-tab command line | 298 // cross-site URLs. Enabled unless we see the --process-per-tab command line |
299 // switch. Can be overridden in unit tests. | 299 // switch. Can be overridden in unit tests. |
300 bool ShouldTransitionCrossSite(); | 300 bool ShouldTransitionCrossSite(); |
301 | 301 |
302 // Returns true if the two navigation entries are incompatible in some way | 302 // Returns true if for the navigation from |current_entry| to |new_entry|, |
303 // other than site instances. Cases where this can happen include Web UI | 303 // a new SiteInstance and BrowsingInstance should be created (even if we are |
304 // to regular web pages. It will cause us to swap RenderViewHosts (and hence | 304 // in a process model that doesn't usually swap). This forces a process swap |
305 // RenderProcessHosts) even if the site instance would otherwise be the same. | 305 // and severs script connections with existing tabs. Cases where this can |
306 // As part of this, we'll also force new SiteInstances and BrowsingInstances. | 306 // happen include transitions between WebUI and regular web pages. |
307 // Either of the entries may be NULL. | 307 // Either of the entries may be NULL. |
308 // TODO(creis): Rename to ShouldSwapBrowsingInstancesForNavigation. | 308 bool ShouldSwapBrowsingInstancesForNavigation( |
309 bool ShouldSwapProcessesForNavigation( | 309 const NavigationEntry* current_entry, |
310 const NavigationEntry* curr_entry, | |
311 const NavigationEntryImpl* new_entry) const; | 310 const NavigationEntryImpl* new_entry) const; |
312 | 311 |
| 312 // Returns true if it is safe to reuse the current WebUI when navigating from |
| 313 // |current_entry| to |new_entry|. |
313 bool ShouldReuseWebUI( | 314 bool ShouldReuseWebUI( |
314 const NavigationEntry* curr_entry, | 315 const NavigationEntry* current_entry, |
315 const NavigationEntryImpl* new_entry) const; | 316 const NavigationEntryImpl* new_entry) const; |
316 | 317 |
317 // Returns an appropriate SiteInstance object for the given NavigationEntry, | 318 // Returns an appropriate SiteInstance object for the given NavigationEntry, |
318 // possibly reusing the current SiteInstance. If --process-per-tab is used, | 319 // possibly reusing the current SiteInstance. If --process-per-tab is used, |
319 // this is only called when ShouldSwapProcessesForNavigation returns true. | 320 // this is only called when ShouldSwapBrowsingInstancesForNavigation returns |
| 321 // true. |
320 SiteInstance* GetSiteInstanceForEntry( | 322 SiteInstance* GetSiteInstanceForEntry( |
321 const NavigationEntryImpl& entry, | 323 const NavigationEntryImpl& entry, |
322 SiteInstance* curr_instance, | 324 SiteInstance* current_instance, |
323 bool force_browsing_instance_swap); | 325 bool force_browsing_instance_swap); |
324 | 326 |
325 // Sets up the necessary state for a new RenderViewHost with the given opener. | 327 // Sets up the necessary state for a new RenderViewHost with the given opener. |
326 bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id); | 328 bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id); |
327 | 329 |
328 // Sets the pending RenderViewHost/WebUI to be the active one. Note that this | 330 // Sets the pending RenderViewHost/WebUI to be the active one. Note that this |
329 // doesn't require the pending render_view_host_ pointer to be non-NULL, since | 331 // doesn't require the pending render_view_host_ pointer to be non-NULL, since |
330 // there could be Web UI switching as well. Call this for every commit. | 332 // there could be Web UI switching as well. Call this for every commit. |
331 void CommitPending(); | 333 void CommitPending(); |
332 | 334 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 InterstitialPageImpl* interstitial_page_; | 398 InterstitialPageImpl* interstitial_page_; |
397 | 399 |
398 NotificationRegistrar registrar_; | 400 NotificationRegistrar registrar_; |
399 | 401 |
400 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager); | 402 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager); |
401 }; | 403 }; |
402 | 404 |
403 } // namespace content | 405 } // namespace content |
404 | 406 |
405 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_VIEW_HOST_MANAGER_H_ | 407 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_VIEW_HOST_MANAGER_H_ |
OLD | NEW |