| Index: content/browser/browsing_instance.h
|
| diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h
|
| index 34c1f073bbd852c260aecf8eade45656d6d10005..d6c72271d7b13e89eeeffeabc7bfae01c142f42d 100644
|
| --- a/content/browser/browsing_instance.h
|
| +++ b/content/browser/browsing_instance.h
|
| @@ -6,6 +6,7 @@
|
| #define CONTENT_BROWSER_BROWSING_INSTANCE_H_
|
|
|
| #include <stddef.h>
|
| +#include <set>
|
|
|
| #include "base/containers/hash_tables.h"
|
| #include "base/gtest_prod_util.h"
|
| @@ -64,6 +65,12 @@ class CONTENT_EXPORT BrowsingInstance final
|
| FRIEND_TEST_ALL_PREFIXES(SiteInstanceTest,
|
| OneSiteInstancePerSiteInBrowserContext);
|
|
|
| + // Lookup for a SiteInstance associated to |url| among all the
|
| + // BrowsingInstances that belongs to |browser_context|.
|
| + static scoped_refptr<SiteInstanceImpl> FindSiteInstance(
|
| + BrowserContext* browser_context,
|
| + const GURL& url);
|
| +
|
| // Create a new BrowsingInstance.
|
| explicit BrowsingInstance(BrowserContext* context);
|
|
|
| @@ -97,6 +104,10 @@ class CONTENT_EXPORT BrowsingInstance final
|
| // BrowsingInstance.
|
| void UnregisterSiteInstance(SiteInstanceImpl* site_instance);
|
|
|
| + void RegisterUsedFor(SiteInstanceImpl* site_instance, std::string site);
|
| + void UnregisterUsedFor(SiteInstanceImpl* site_instance,
|
| + const std::set<std::string>& sites);
|
| +
|
| // Tracks the number of WebContents currently in this BrowsingInstance.
|
| size_t active_contents_count() const { return active_contents_count_; }
|
| void increment_active_contents_count() { active_contents_count_++; }
|
| @@ -122,6 +133,11 @@ class CONTENT_EXPORT BrowsingInstance final
|
| // site, such as about:blank. See NavigatorImpl::ShouldAssignSiteForURL.
|
| SiteInstanceMap site_instance_map_;
|
|
|
| + // Keeps track of all the SiteInstances that displayed which sites.
|
| + using SiteToSiteInstanceMap =
|
| + std::map<std::string, std::set<SiteInstanceImpl*>>;
|
| + SiteToSiteInstanceMap site_to_site_instance_map_;
|
| +
|
| // Number of WebContentses currently using this BrowsingInstance.
|
| size_t active_contents_count_;
|
|
|
|
|