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

Side by Side Diff: chrome/browser/extensions/chrome_extension_web_contents_observer.cc

Issue 1682253006: Add a control group to the SiteIsolationExtensionsActive. It corresponds to the Disabled group of t… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uma3
Patch Set: Set correct upstream Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/site_details_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/chrome_extension_web_contents_observer.h" 5 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h"
8 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/error_console/error_console.h" 10 #include "chrome/browser/extensions/error_console/error_console.h"
10 #include "chrome/browser/extensions/extension_service.h" 11 #include "chrome/browser/extensions/extension_service.h"
11 #include "chrome/browser/extensions/window_controller.h" 12 #include "chrome/browser/extensions/window_controller.h"
12 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" 13 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
13 #include "chrome/common/extensions/chrome_extension_messages.h" 14 #include "chrome/common/extensions/chrome_extension_messages.h"
14 #include "chrome/common/extensions/extension_process_policy.h" 15 #include "chrome/common/extensions/extension_process_policy.h"
15 #include "chrome/common/url_constants.h" 16 #include "chrome/common/url_constants.h"
16 #include "components/rappor/rappor_service.h" 17 #include "components/rappor/rappor_service.h"
17 #include "content/public/browser/browser_context.h" 18 #include "content/public/browser/browser_context.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } else if (extensions::IsIsolateExtensionsEnabled()) { 199 } else if (extensions::IsIsolateExtensionsEnabled()) {
199 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 200 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
200 switches::kIsolateExtensions)) { 201 switches::kIsolateExtensions)) {
201 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( 202 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(
202 "SiteIsolationExtensionsActive", "IsolateExtensionsFlag"); 203 "SiteIsolationExtensionsActive", "IsolateExtensionsFlag");
203 } else { 204 } else {
204 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( 205 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(
205 "SiteIsolationExtensionsActive", "FieldTrial"); 206 "SiteIsolationExtensionsActive", "FieldTrial");
206 } 207 }
207 } else { 208 } else {
208 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( 209 if (!base::FieldTrialList::FindFullName("SiteIsolationExtensions")
209 "SiteIsolationExtensionsActive", "Default"); 210 .empty()) {
211 // The field trial is active, but we are in a control group with oopifs
212 // disabled.
213 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(
214 "SiteIsolationExtensionsActive", "Control");
215 } else {
216 // The field trial is not active for this version.
217 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(
218 "SiteIsolationExtensionsActive", "Default");
219 }
210 } 220 }
211 221
212 if (rappor::RapporService* rappor = g_browser_process->rappor_service()) { 222 if (rappor::RapporService* rappor = g_browser_process->rappor_service()) {
213 const std::string& extension_id = 223 const std::string& extension_id =
214 parent_is_extension ? parent_url.host() : frame_url.host(); 224 parent_is_extension ? parent_url.host() : frame_url.host();
215 rappor->RecordSample("Extensions.AffectedByIsolateExtensions", 225 rappor->RecordSample("Extensions.AffectedByIsolateExtensions",
216 rappor::UMA_RAPPOR_TYPE, extension_id); 226 rappor::UMA_RAPPOR_TYPE, extension_id);
217 } 227 }
218 } 228 }
219 } 229 }
220 230
221 } // namespace extensions 231 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/site_details_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698