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

Unified Diff: content/browser/browsing_instance.h

Issue 9221017: Hide BrowsingInstance from all but SiteInstance, as intended by design. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 11 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
« no previous file with comments | « chrome/browser/ui/webui/options/extension_settings_handler.cc ('k') | content/browser/browsing_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browsing_instance.h
diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h
index 71c4695886f59fcd0d4cf775fd5f197e199f33e9..62b7d5f86f2ebab2b75d36926c8821ab9eb6e230 100644
--- a/content/browser/browsing_instance.h
+++ b/content/browser/browsing_instance.h
@@ -50,16 +50,17 @@ class BrowserContext;
// have references to it. Because both classes are RefCounted, they do not
// need to be manually deleted.
//
-// Currently, the BrowsingInstance class is not visible outside of the
-// SiteInstance class. To get a new SiteInstance that is part of the same
-// BrowsingInstance, use SiteInstance::GetRelatedSiteInstance. Because of
-// this, BrowsingInstances and SiteInstances are tested together in
+// BrowsingInstance has no public members, as it is designed to be
+// visible only from the SiteInstance class. To get a new
+// SiteInstance that is part of the same BrowsingInstance, use
+// SiteInstance::GetRelatedSiteInstance. Because of this,
+// BrowsingInstances and SiteInstances are tested together in
// site_instance_unittest.cc.
//
///////////////////////////////////////////////////////////////////////////////
class CONTENT_EXPORT BrowsingInstance
: public base::RefCounted<BrowsingInstance> {
- public:
+ protected:
// Create a new BrowsingInstance.
explicit BrowsingInstance(content::BrowserContext* context);
@@ -70,7 +71,7 @@ class CONTENT_EXPORT BrowsingInstance
virtual bool ShouldUseProcessPerSite(const GURL& url);
// Get the browser context to which this BrowsingInstance belongs.
- content::BrowserContext* browser_context() { return browser_context_; }
+ content::BrowserContext* browser_context() const { return browser_context_; }
// Returns whether this BrowsingInstance has registered a SiteInstance for
// the site of the given URL.
@@ -91,7 +92,8 @@ class CONTENT_EXPORT BrowsingInstance
// BrowsingInstance.
void UnregisterSiteInstance(SiteInstance* site_instance);
- protected:
+ friend class SiteInstance;
+
friend class base::RefCounted<BrowsingInstance>;
// Virtual to allow tests to extend it.
« no previous file with comments | « chrome/browser/ui/webui/options/extension_settings_handler.cc ('k') | content/browser/browsing_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698