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

Unified Diff: content/browser/site_instance_impl.h

Issue 257083002: Check BrowsingInstance before swapping prerenders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/site_instance_impl.h
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index edaeb3e702d75910effe7b4064ba20a3396ad84e..69197eeeab4465e9b6f56c596773eeb09aa6a378 100644
--- a/content/browser/site_instance_impl.h
+++ b/content/browser/site_instance_impl.h
@@ -12,6 +12,7 @@
#include "url/gurl.h"
namespace content {
+class BrowsingInstance;
class RenderProcessHostFactory;
class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance,
@@ -21,10 +22,11 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance,
virtual int32 GetId() OVERRIDE;
virtual bool HasProcess() const OVERRIDE;
virtual RenderProcessHost* GetProcess() OVERRIDE;
+ virtual BrowserContext* GetBrowserContext() const OVERRIDE;
virtual const GURL& GetSiteURL() const OVERRIDE;
virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) OVERRIDE;
virtual bool IsRelatedSiteInstance(const SiteInstance* instance) OVERRIDE;
- virtual BrowserContext* GetBrowserContext() const OVERRIDE;
+ virtual size_t GetRelatedActiveContentsCount() OVERRIDE;
// Set the web site that this SiteInstance is rendering pages for.
// This includes the scheme and registered domain, but not the port. If the
@@ -59,6 +61,14 @@ class CONTENT_EXPORT SiteInstanceImpl : public SiteInstance,
// discarded to save memory.
size_t active_view_count() { return active_view_count_; }
+ // Increase the number of active WebContentses using this SiteInstance. Note
+ // that, unlike active_view_count, this does not count pending RVHs.
+ void IncrementRelatedActiveContentsCount();
+
+ // Decrease the number of active WebContentses using this SiteInstance. Note
+ // that, unlike active_view_count, this does not count pending RVHs.
+ void DecrementRelatedActiveContentsCount();
+
// Sets the global factory used to create new RenderProcessHosts. It may be
// NULL, in which case the default BrowserRenderProcessHost will be created
// (this is the behavior if you don't call this function). The factory must
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager_unittest.cc ('k') | content/browser/site_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698