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

Unified Diff: content/browser/browsing_instance.h

Issue 1845233003: SiteInstance unittest improvements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@doghouse_now
Patch Set: Add missing #include for FRIEND_TEST Created 4 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
« no previous file with comments | « no previous file | content/browser/site_instance_impl.h » ('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 4beb487b9a01a846785609102490334c10ee95a8..34c1f073bbd852c260aecf8eade45656d6d10005 100644
--- a/content/browser/browsing_instance.h
+++ b/content/browser/browsing_instance.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include "base/containers/hash_tables.h"
+#include "base/gtest_prod_util.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
@@ -54,12 +55,20 @@ class SiteInstanceImpl;
// site_instance_unittest.cc.
//
///////////////////////////////////////////////////////////////////////////////
-class CONTENT_EXPORT BrowsingInstance
+class CONTENT_EXPORT BrowsingInstance final
: public base::RefCounted<BrowsingInstance> {
- protected:
+ private:
+ friend class base::RefCounted<BrowsingInstance>;
+ friend class SiteInstanceImpl;
+ FRIEND_TEST_ALL_PREFIXES(SiteInstanceTest, OneSiteInstancePerSite);
+ FRIEND_TEST_ALL_PREFIXES(SiteInstanceTest,
+ OneSiteInstancePerSiteInBrowserContext);
+
// Create a new BrowsingInstance.
explicit BrowsingInstance(BrowserContext* context);
+ ~BrowsingInstance();
+
// Get the browser context to which this BrowsingInstance belongs.
BrowserContext* browser_context() const { return browser_context_; }
@@ -96,14 +105,6 @@ class CONTENT_EXPORT BrowsingInstance
active_contents_count_--;
}
- friend class SiteInstanceImpl;
-
- friend class base::RefCounted<BrowsingInstance>;
-
- // Virtual to allow tests to extend it.
- virtual ~BrowsingInstance();
-
- private:
// Map of site to SiteInstance, to ensure we only have one SiteInstance per
// site.
typedef base::hash_map<std::string, SiteInstanceImpl*> SiteInstanceMap;
« no previous file with comments | « no previous file | content/browser/site_instance_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698