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 #include "chrome/browser/site_details.h" | 5 #include "chrome/browser/site_details.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 case ISOLATE_NOTHING: | 33 case ISOLATE_NOTHING: |
34 return false; | 34 return false; |
35 case ISOLATE_ALL_SITES: | 35 case ISOLATE_ALL_SITES: |
36 return true; | 36 return true; |
37 case ISOLATE_HTTPS_SITES: | 37 case ISOLATE_HTTPS_SITES: |
38 // Note: For estimation purposes "isolate https sites" is really | 38 // Note: For estimation purposes "isolate https sites" is really |
39 // implemented as "isolate non-http sites". This means that, for example, | 39 // implemented as "isolate non-http sites". This means that, for example, |
40 // the New Tab Page gets counted as two processes under this policy, and | 40 // the New Tab Page gets counted as two processes under this policy, and |
41 // extensions are isolated as well. | 41 // extensions are isolated as well. |
42 return !site.SchemeIs(url::kHttpScheme); | 42 return !site.SchemeIs(url::kHttpScheme); |
43 case ISOLATE_EXTENSIONS: { | |
ncarter (slow)
2017/05/01 20:15:19
I don't think it's necessary to remove this? If a
nasko
2017/05/01 21:25:37
The way I read this code is "What should our numbe
ncarter (slow)
2017/05/01 21:37:43
The value of computing the simulated ISOLATE_EXTEN
| |
44 #if !BUILDFLAG(ENABLE_EXTENSIONS) | |
45 return false; | |
46 #else | |
47 if (!site.SchemeIs(extensions::kExtensionScheme)) | |
48 return false; | |
49 extensions::ExtensionRegistry* registry = | |
50 extensions::ExtensionRegistry::Get(browser_context); | |
51 const extensions::Extension* extension = | |
52 registry->enabled_extensions().GetExtensionOrAppByURL(site); | |
53 return extension && !extension->is_hosted_app(); | |
54 #endif | |
55 } | |
56 } | 43 } |
57 NOTREACHED(); | 44 NOTREACHED(); |
58 return true; | 45 return true; |
59 } | 46 } |
60 | 47 |
61 content::SiteInstance* DeterminePrimarySiteInstance( | 48 content::SiteInstance* DeterminePrimarySiteInstance( |
62 content::SiteInstance* site_instance, | 49 content::SiteInstance* site_instance, |
63 SiteData* site_data) { | 50 SiteData* site_data) { |
64 // Find the BrowsingInstance this WebContents belongs to by iterating over | 51 // Find the BrowsingInstance this WebContents belongs to by iterating over |
65 // the "primary" SiteInstances of each BrowsingInstance we've seen so far. | 52 // the "primary" SiteInstances of each BrowsingInstance we've seen so far. |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 num_isolated_site_instances[ISOLATE_HTTPS_SITES]); | 257 num_isolated_site_instances[ISOLATE_HTTPS_SITES]); |
271 UMA_HISTOGRAM_COUNTS_100( | 258 UMA_HISTOGRAM_COUNTS_100( |
272 "SiteIsolation.IsolateHttpsSitesProcessCountLowerBound", | 259 "SiteIsolation.IsolateHttpsSitesProcessCountLowerBound", |
273 process_count_lower_bound[ISOLATE_HTTPS_SITES]); | 260 process_count_lower_bound[ISOLATE_HTTPS_SITES]); |
274 UMA_HISTOGRAM_COUNTS_100( | 261 UMA_HISTOGRAM_COUNTS_100( |
275 "SiteIsolation.IsolateHttpsSitesProcessCountEstimate", | 262 "SiteIsolation.IsolateHttpsSitesProcessCountEstimate", |
276 process_count_estimate[ISOLATE_HTTPS_SITES]); | 263 process_count_estimate[ISOLATE_HTTPS_SITES]); |
277 UMA_HISTOGRAM_COUNTS_100( | 264 UMA_HISTOGRAM_COUNTS_100( |
278 "SiteIsolation.IsolateHttpsSitesTotalProcessCountEstimate", | 265 "SiteIsolation.IsolateHttpsSitesTotalProcessCountEstimate", |
279 process_count_estimate[ISOLATE_HTTPS_SITES] + non_renderer_process_count); | 266 process_count_estimate[ISOLATE_HTTPS_SITES] + non_renderer_process_count); |
280 | |
281 // ISOLATE_EXTENSIONS metrics. | |
282 UMA_HISTOGRAM_COUNTS_100("SiteIsolation.IsolateExtensionsProcessCountNoLimit", | |
283 num_isolated_site_instances[ISOLATE_EXTENSIONS]); | |
284 UMA_HISTOGRAM_COUNTS_100( | |
285 "SiteIsolation.IsolateExtensionsProcessCountLowerBound", | |
286 process_count_lower_bound[ISOLATE_EXTENSIONS]); | |
287 UMA_HISTOGRAM_COUNTS_100( | |
288 "SiteIsolation.IsolateExtensionsProcessCountEstimate", | |
289 process_count_estimate[ISOLATE_EXTENSIONS]); | |
290 UMA_HISTOGRAM_COUNTS_100( | |
291 "SiteIsolation.IsolateExtensionsTotalProcessCountEstimate", | |
292 process_count_estimate[ISOLATE_EXTENSIONS] + non_renderer_process_count); | |
293 } | 267 } |
OLD | NEW |