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

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: creis comments Created 6 years, 8 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..68725cc9b8ac224fe4f0ecf1c703ab02dfe73825 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() const 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 on this SiteInstance. Note
Charlie Reis 2014/04/29 22:13:51 nit: on -> using (here, below, and in browsing_ins
davidben 2014/04/29 23:02:26 Done.
+ // that, unlike active_view_count, this does not count pending RVHs.
+ void IncrementRelatedActiveContentsCount();
+
+ // Decrease the number of active WebContentses on 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

Powered by Google App Engine
This is Rietveld 408576698