| 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" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // use in estimating the number of processes needed for various process models. | 38 // use in estimating the number of processes needed for various process models. |
| 39 struct SiteData { | 39 struct SiteData { |
| 40 SiteData(); | 40 SiteData(); |
| 41 ~SiteData(); | 41 ~SiteData(); |
| 42 | 42 |
| 43 // One IsolationScenario object per IsolationScenarioType. | 43 // One IsolationScenario object per IsolationScenarioType. |
| 44 IsolationScenario scenarios[ISOLATION_SCENARIO_LAST + 1]; | 44 IsolationScenario scenarios[ISOLATION_SCENARIO_LAST + 1]; |
| 45 | 45 |
| 46 // Global list of all SiteInstances, used for de-duping related instances. | 46 // Global list of all SiteInstances, used for de-duping related instances. |
| 47 std::vector<content::SiteInstance*> instances; | 47 std::vector<content::SiteInstance*> instances; |
| 48 |
| 49 // A set of all RenderFrameHosts, which are in a different SiteInstance from |
| 50 // their parents. |
| 51 std::set<content::RenderFrameHost*> out_of_process_frames; |
| 48 }; | 52 }; |
| 49 | 53 |
| 50 // Maps a BrowserContext to information about the sites it contains. | 54 // Maps a BrowserContext to information about the sites it contains. |
| 51 typedef base::hash_map<content::BrowserContext*, SiteData> | 55 typedef base::hash_map<content::BrowserContext*, SiteData> |
| 52 BrowserContextSiteDataMap; | 56 BrowserContextSiteDataMap; |
| 53 | 57 |
| 54 class SiteDetails { | 58 class SiteDetails { |
| 55 public: | 59 public: |
| 56 // Collect information about all committed sites in the given WebContents | 60 // Collect information about all committed sites in the given WebContents |
| 57 // on the UI thread. | 61 // on the UI thread. |
| 58 static void CollectSiteInfo(content::WebContents* contents, | 62 static void CollectSiteInfo(content::WebContents* contents, |
| 59 SiteData* site_data); | 63 SiteData* site_data); |
| 60 | 64 |
| 61 // Updates the global histograms for tracking memory usage. | 65 // Updates the global histograms for tracking memory usage. |
| 62 static void UpdateHistograms(const BrowserContextSiteDataMap& site_data_map, | 66 static void UpdateHistograms(const BrowserContextSiteDataMap& site_data_map, |
| 63 int all_renderer_process_count, | 67 int all_renderer_process_count, |
| 64 int non_renderer_process_count); | 68 int non_renderer_process_count); |
| 65 | 69 |
| 66 private: | 70 private: |
| 67 // Never needs to be constructed. | 71 // Never needs to be constructed. |
| 68 SiteDetails(); | 72 SiteDetails(); |
| 69 ~SiteDetails(); | 73 ~SiteDetails(); |
| 70 | 74 |
| 71 DISALLOW_COPY_AND_ASSIGN(SiteDetails); | 75 DISALLOW_COPY_AND_ASSIGN(SiteDetails); |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 #endif // CHROME_BROWSER_SITE_DETAILS_H_ | 78 #endif // CHROME_BROWSER_SITE_DETAILS_H_ |
| OLD | NEW |