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

Unified Diff: chrome/browser/site_details.h

Issue 1313863006: Add SiteIsolation.IsolateExtensions metrics and tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempt to fix clang compile warning. Created 5 years, 3 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 | chrome/browser/site_details.cc » ('j') | chrome/browser/site_details.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/site_details.h
diff --git a/chrome/browser/site_details.h b/chrome/browser/site_details.h
index 4eb99b97eeba1cb4c3fdfc1d742e84df4a3a5ffa..a8833d2601ac634b5f731d1c0c947019485882cd 100644
--- a/chrome/browser/site_details.h
+++ b/chrome/browser/site_details.h
@@ -11,7 +11,32 @@
#include "content/public/browser/web_contents.h"
// Maps an ID representing each BrowsingInstance to a set of site URLs.
-typedef base::hash_map<int32, std::set<GURL> > BrowsingInstanceSiteMap;
+typedef base::hash_map<int32, std::set<GURL>> BrowsingInstanceSiteMap;
+
+// This enum represents various alternative process model policies that we want
+// to evaluate. We'll estimate the process cost of each scenario.
+enum IsolationScenarioType {
+ ISOLATE_ALL_SITES,
+ ISOLATE_HTTPS_SITES,
+ ISOLATE_EXTENSIONS,
+ ISOLATION_SCENARIO_LAST = ISOLATE_EXTENSIONS
+};
+
+// Contains the state required to estimate the process count under a particular
+// process model. We have one of these per IsolationScenarioType.
+struct IsolationScenario {
+ IsolationScenario();
+ ~IsolationScenario();
+
+ void CollectSiteInfoForScenario(content::SiteInstance* primary,
+ const GURL& site);
+ void GetProcessCountEstimate();
+ void GetProcessCountLowerBound();
+
+ IsolationScenarioType policy;
+ std::set<GURL> sites;
+ BrowsingInstanceSiteMap browsing_instance_site_map;
+};
// Information about the sites and SiteInstances in each BrowsingInstance, for
// use in estimating the number of processes needed for various process models.
@@ -19,14 +44,14 @@ struct SiteData {
SiteData();
~SiteData();
- std::set<GURL> sites;
- std::set<GURL> https_sites;
+ // One IsolationScenario object per IsolationScenarioType.
+ IsolationScenario scenarios[ISOLATION_SCENARIO_LAST + 1];
+
+ // Global list of all SiteInstances, used for de-duping related instances.
std::vector<content::SiteInstance*> instances;
- BrowsingInstanceSiteMap instance_site_map;
- BrowsingInstanceSiteMap instance_https_site_map;
};
-// Maps a BrowserContext to information about the SiteInstances it contains.
+// Maps a BrowserContext to information about the sites it contains.
nasko 2015/09/04 22:19:43 Why not SiteInstances?
ncarter (slow) 2015/09/10 19:08:58 Because SiteInstances reflect the active process m
typedef base::hash_map<content::BrowserContext*, SiteData>
BrowserContextSiteDataMap;
« no previous file with comments | « no previous file | chrome/browser/site_details.cc » ('j') | chrome/browser/site_details.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698