| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SITE_DETAILS_H_ | 5 #ifndef CHROME_BROWSER_SITE_DETAILS_H_ |
| 6 #define CHROME_BROWSER_SITE_DETAILS_H_ | 6 #define CHROME_BROWSER_SITE_DETAILS_H_ |
| 7 | 7 |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 #include "content/public/browser/site_instance.h" | 10 #include "content/public/browser/site_instance.h" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 | 12 |
| 13 // Maps an ID representing each BrowsingInstance to a set of site URLs. | 13 // Maps an ID representing each BrowsingInstance to a set of site URLs. |
| 14 typedef base::hash_map<int32, std::set<GURL>> BrowsingInstanceSiteMap; | 14 using BrowsingInstanceSiteMap = base::hash_map<int32, std::set<GURL>>; |
| 15 |
| 16 // Maps a SiteInstance to a set of all SiteInstances in the same |
| 17 // BrowsingInstance. |
| 18 using SiteInstanceMap = |
| 19 base::hash_map<content::SiteInstance*, std::set<content::SiteInstance*>>; |
| 15 | 20 |
| 16 // This enum represents various alternative process model policies that we want | 21 // This enum represents various alternative process model policies that we want |
| 17 // to evaluate. We'll estimate the process cost of each scenario. | 22 // to evaluate. We'll estimate the process cost of each scenario. |
| 18 enum IsolationScenarioType { | 23 enum IsolationScenarioType { |
| 19 ISOLATE_NOTHING, | 24 ISOLATE_NOTHING, |
| 20 ISOLATE_ALL_SITES, | 25 ISOLATE_ALL_SITES, |
| 21 ISOLATE_HTTPS_SITES, | 26 ISOLATE_HTTPS_SITES, |
| 22 ISOLATE_EXTENSIONS, | 27 ISOLATE_EXTENSIONS, |
| 23 ISOLATION_SCENARIO_LAST = ISOLATE_EXTENSIONS | 28 ISOLATION_SCENARIO_LAST = ISOLATE_EXTENSIONS |
| 24 }; | 29 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 // Information about the sites and SiteInstances in each BrowsingInstance, for | 42 // Information about the sites and SiteInstances in each BrowsingInstance, for |
| 38 // use in estimating the number of processes needed for various process models. | 43 // use in estimating the number of processes needed for various process models. |
| 39 struct SiteData { | 44 struct SiteData { |
| 40 SiteData(); | 45 SiteData(); |
| 41 ~SiteData(); | 46 ~SiteData(); |
| 42 | 47 |
| 43 // One IsolationScenario object per IsolationScenarioType. | 48 // One IsolationScenario object per IsolationScenarioType. |
| 44 IsolationScenario scenarios[ISOLATION_SCENARIO_LAST + 1]; | 49 IsolationScenario scenarios[ISOLATION_SCENARIO_LAST + 1]; |
| 45 | 50 |
| 46 // Global list of all SiteInstances, used for de-duping related instances. | 51 // Global list of all SiteInstances, used for de-duping related instances. |
| 47 std::vector<content::SiteInstance*> instances; | 52 // It also keeps a set of all SiteInstances in the BrowsingInstance identified |
| 53 // by the SiteInstance used as the key. |
| 54 SiteInstanceMap instances; |
| 48 | 55 |
| 49 // A count of all RenderFrameHosts, which are in a different SiteInstance from | 56 // A count of all RenderFrameHosts, which are in a different SiteInstance from |
| 50 // their parents. | 57 // their parents. |
| 51 int out_of_process_frames; | 58 int out_of_process_frames; |
| 52 }; | 59 }; |
| 53 | 60 |
| 54 // Maps a BrowserContext to information about the sites it contains. | 61 // Maps a BrowserContext to information about the sites it contains. |
| 55 typedef base::hash_map<content::BrowserContext*, SiteData> | 62 typedef base::hash_map<content::BrowserContext*, SiteData> |
| 56 BrowserContextSiteDataMap; | 63 BrowserContextSiteDataMap; |
| 57 | 64 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 69 | 76 |
| 70 private: | 77 private: |
| 71 // Never needs to be constructed. | 78 // Never needs to be constructed. |
| 72 SiteDetails(); | 79 SiteDetails(); |
| 73 ~SiteDetails(); | 80 ~SiteDetails(); |
| 74 | 81 |
| 75 DISALLOW_COPY_AND_ASSIGN(SiteDetails); | 82 DISALLOW_COPY_AND_ASSIGN(SiteDetails); |
| 76 }; | 83 }; |
| 77 | 84 |
| 78 #endif // CHROME_BROWSER_SITE_DETAILS_H_ | 85 #endif // CHROME_BROWSER_SITE_DETAILS_H_ |
| OLD | NEW |