summaryrefslogtreecommitdiffstats
path: root/content/browser/site_instance_impl.h
diff options
context:
space:
mode:
authordavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-15 05:50:18 +0000
committerdavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-15 05:50:18 +0000
commitd5072a821b4f9651e1c0a38ffca8ad5a69bf476e (patch)
tree734c5995b7e7e6d025214c7cce27ca6a19d8a58a /content/browser/site_instance_impl.h
parentdd9ce3382723d5b10eaf96bad0fd00e7eb8c2ba0 (diff)
downloadchromium_src-d5072a821b4f9651e1c0a38ffca8ad5a69bf476e.zip
chromium_src-d5072a821b4f9651e1c0a38ffca8ad5a69bf476e.tar.gz
chromium_src-d5072a821b4f9651e1c0a38ffca8ad5a69bf476e.tar.bz2
Check BrowsingInstance before swapping prerenders.
Even if a WebContents does not have an opener, if there is another WebContents in the BrowsingInstance, swapping processes can break pages which expect script access. BUG=118294 Review URL: https://codereview.chromium.org/257083002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/site_instance_impl.h')
-rw-r--r--content/browser/site_instance_impl.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index edaeb3e..69197ee 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