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

Unified Diff: chrome/browser/domain_reliability/service_factory.cc

Issue 525303004: Domain Reliability: Don't create Service if metrics reporting disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Even even simpler. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/domain_reliability/service_factory.cc
diff --git a/chrome/browser/domain_reliability/service_factory.cc b/chrome/browser/domain_reliability/service_factory.cc
index 0809074b7def79e2dd450288d97484ca1b6aa194..21346a40f2672dc002732160dd423664096fbc90 100644
--- a/chrome/browser/domain_reliability/service_factory.cc
+++ b/chrome/browser/domain_reliability/service_factory.cc
@@ -6,7 +6,10 @@
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
+#include "base/prefs/pref_service.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "components/domain_reliability/service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/browser_context.h"
@@ -56,6 +59,10 @@ KeyedService* DomainReliabilityServiceFactory::BuildServiceInstanceFor(
if (!IsDomainReliabilityMonitoringEnabled())
return NULL;
+ if (!g_browser_process->local_state()->GetBoolean(
+ prefs::kMetricsReportingEnabled))
+ return NULL;
mmenke 2014/09/03 17:12:40 nit: Use braces when the conditional takes up mul
+
return DomainReliabilityService::Create(
kDomainReliabilityUploadReporterString);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698