diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 13:39:02 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 13:39:02 +0000 |
commit | 72daaa97d67f7c722eaf9eabf125427506ee8d45 (patch) | |
tree | 23e2d82b58b9e48061283ba6f2045f4b3864b668 /content/browser/browsing_instance.h | |
parent | 9e855c0a40e07fa78d9abb4961b35e750627caf4 (diff) | |
download | chromium_src-72daaa97d67f7c722eaf9eabf125427506ee8d45.zip chromium_src-72daaa97d67f7c722eaf9eabf125427506ee8d45.tar.gz chromium_src-72daaa97d67f7c722eaf9eabf125427506ee8d45.tar.bz2 |
Hide BrowsingInstance from all but SiteInstance, as intended by design.
See comment on BrowsingInstance class that explains it should only be
visible to SiteInstance. By restoring this design, we also eliminate
one Chrome->Content dependency.
TBR=ben@chromium.org
BUG=98716
Review URL: http://codereview.chromium.org/9221017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118090 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browsing_instance.h')
-rw-r--r-- | content/browser/browsing_instance.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h index 71c4695..d3baf8a 100644 --- a/content/browser/browsing_instance.h +++ b/content/browser/browsing_instance.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -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. |