Commit 207b7651 authored by Alex Moshchuk's avatar Alex Moshchuk

Add metrics to count how often site isolation flags get turned on.

Bug: 794336, 793471
Change-Id: I035823fe6cf0f2f063e58707f3b8a4eba6748ee8
Reviewed-on: https://chromium-review.googlesource.com/823246
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523628}
parent 125727bb
...@@ -916,6 +916,9 @@ int BrowserMainLoop::PreCreateThreads() { ...@@ -916,6 +916,9 @@ int BrowserMainLoop::PreCreateThreads() {
policy->AddIsolatedOrigins( policy->AddIsolatedOrigins(
GetContentClient()->browser()->GetOriginsRequiringDedicatedProcess()); GetContentClient()->browser()->GetOriginsRequiringDedicatedProcess());
// Record metrics about which site isolation flags have been turned on.
SiteIsolationPolicy::RecordSiteIsolationFlagUsage();
return result_code_; return result_code_;
} }
......
...@@ -94,4 +94,20 @@ std::vector<url::Origin> SiteIsolationPolicy::ParseIsolatedOrigins( ...@@ -94,4 +94,20 @@ std::vector<url::Origin> SiteIsolationPolicy::ParseIsolatedOrigins(
return origins; return origins;
} }
// static
void SiteIsolationPolicy::RecordSiteIsolationFlagUsage() {
// For --site-per-process and --isolate-origins, include flags specified on
// command-line, in chrome://flags, and via enterprise policy (i.e., include
// switches::kSitePerProcess and switches::kIsolateOrigins). Exclude these
// modes being set through field trials (i.e., exclude
// features::kSitePerProcess and features::IsolateOrigins).
UMA_HISTOGRAM_BOOLEAN("SiteIsolation.Flags.IsolateOrigins",
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kIsolateOrigins));
UMA_HISTOGRAM_BOOLEAN("SiteIsolation.Flags.SitePerProcess",
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSitePerProcess));
}
} // namespace content } // namespace content
...@@ -49,6 +49,10 @@ class CONTENT_EXPORT SiteIsolationPolicy { ...@@ -49,6 +49,10 @@ class CONTENT_EXPORT SiteIsolationPolicy {
// ContentBrowserClient::GetOriginsRequiringDedicatedProcess. // ContentBrowserClient::GetOriginsRequiringDedicatedProcess.
static std::vector<url::Origin> GetIsolatedOrigins(); static std::vector<url::Origin> GetIsolatedOrigins();
// Records metrics about which site isolation command-line flags are present.
// This should be called once on browser startup.
static void RecordSiteIsolationFlagUsage();
private: private:
SiteIsolationPolicy(); // Not instantiable. SiteIsolationPolicy(); // Not instantiable.
......
...@@ -81696,6 +81696,22 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -81696,6 +81696,22 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary> </summary>
</histogram> </histogram>
<histogram name="SiteIsolation.Flags.IsolateOrigins" enum="BooleanEnabled">
<owner>alexmos@chromium.org</owner>
<summary>
True if the --isolate-origins mode was enabled from the command line,
about:flags, or enterprise policy. Recorded on browser startup.
</summary>
</histogram>
<histogram name="SiteIsolation.Flags.SitePerProcess" enum="BooleanEnabled">
<owner>alexmos@chromium.org</owner>
<summary>
True if the --site-per-process mode was enabled from the command line,
about:flags, or enterprise policy. Recorded on browser startup.
</summary>
</histogram>
<histogram name="SiteIsolation.IsolateAllSitesProcessCountEstimate"> <histogram name="SiteIsolation.IsolateAllSitesProcessCountEstimate">
<owner>creis@chromium.org</owner> <owner>creis@chromium.org</owner>
<summary> <summary>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment