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

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

Issue 57433010: Prevent creating a swapped out RVH in the same SiteInstance as the current one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More diagnosis. Created 7 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 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
292 // cross-site URLs. Enabled unless we see the --process-per-tab command line 292 // cross-site URLs. Enabled unless we see the --process-per-tab command line
293 // switch. Can be overridden in unit tests. 293 // switch. Can be overridden in unit tests.
294 bool ShouldTransitionCrossSite(); 294 bool ShouldTransitionCrossSite();
295 295
296 // Returns true if the two navigation entries are incompatible in some way 296 // Returns true if the two navigation entries are incompatible in some way
297 // other than site instances. Cases where this can happen include Web UI 297 // other than site instances. Cases where this can happen include Web UI
298 // to regular web pages. It will cause us to swap RenderViewHosts (and hence 298 // to regular web pages. It will cause us to swap RenderViewHosts (and hence
299 // RenderProcessHosts) even if the site instance would otherwise be the same. 299 // RenderProcessHosts) even if the site instance would otherwise be the same.
300 // As part of this, we'll also force new SiteInstances and BrowsingInstances. 300 // As part of this, we'll also force new SiteInstances and BrowsingInstances.
301 // Either of the entries may be NULL. 301 // Either of the entries may be NULL.
302 // TODO(creis): Rename to ShouldSwapBrowsingInstancesForNavigation.
302 bool ShouldSwapProcessesForNavigation( 303 bool ShouldSwapProcessesForNavigation(
303 const NavigationEntry* curr_entry, 304 const NavigationEntry* curr_entry,
304 const NavigationEntryImpl* new_entry) const; 305 const NavigationEntryImpl* new_entry) const;
305 306
306 bool ShouldReuseWebUI( 307 bool ShouldReuseWebUI(
307 const NavigationEntry* curr_entry, 308 const NavigationEntry* curr_entry,
308 const NavigationEntryImpl* new_entry) const; 309 const NavigationEntryImpl* new_entry) const;
309 310
310 // Returns an appropriate SiteInstance object for the given NavigationEntry, 311 // Returns an appropriate SiteInstance object for the given NavigationEntry,
311 // possibly reusing the current SiteInstance. 312 // possibly reusing the current SiteInstance. If --process-per-tab is used,
312 // Never called if --process-per-tab is used. 313 // this is only called when ShouldSwapProcessesForNavigation reutrns true.
ncarter (slow) 2013/11/12 03:38:26 typo "reutrns"
Charlie Reis 2013/11/12 16:09:35 Done.
313 SiteInstance* GetSiteInstanceForEntry( 314 SiteInstance* GetSiteInstanceForEntry(
314 const NavigationEntryImpl& entry, 315 const NavigationEntryImpl& entry,
315 SiteInstance* curr_instance); 316 SiteInstance* curr_instance,
317 bool force_browsing_instance_swap);
316 318
317 // Sets up the necessary state for a new RenderViewHost with the given opener. 319 // Sets up the necessary state for a new RenderViewHost with the given opener.
318 bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id); 320 bool InitRenderView(RenderViewHost* render_view_host, int opener_route_id);
319 321
320 // Sets the pending RenderViewHost/WebUI to be the active one. Note that this 322 // Sets the pending RenderViewHost/WebUI to be the active one. Note that this
321 // doesn't require the pending render_view_host_ pointer to be non-NULL, since 323 // doesn't require the pending render_view_host_ pointer to be non-NULL, since
322 // there could be Web UI switching as well. Call this for every commit. 324 // there could be Web UI switching as well. Call this for every commit.
323 void CommitPending(); 325 void CommitPending();
324 326
325 // Shutdown all RenderViewHosts in a SiteInstance. This is called 327 // Shutdown all RenderViewHosts in a SiteInstance. This is called
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 InterstitialPageImpl* interstitial_page_; 390 InterstitialPageImpl* interstitial_page_;
389 391
390 NotificationRegistrar registrar_; 392 NotificationRegistrar registrar_;
391 393
392 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager); 394 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManager);
393 }; 395 };
394 396
395 } // namespace content 397 } // namespace content
396 398
397 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_VIEW_HOST_MANAGER_H_ 399 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_VIEW_HOST_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698