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

Unified Diff: content/browser/browsing_instance.h

Issue 2803673006: PlzNavigate: ensure we don't create extra-processes for ServiceWorkers (Closed)
Patch Set: Created 3 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/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 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_;
« no previous file with comments | « no previous file | content/browser/browsing_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698