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

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 10392007: Restoring the chrome variatioons client, with a fix for browser_test failures caused by it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: max retries in a const Created 8 years, 7 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
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index e3a7bb5055245a185bb95fb5f281468dcb9b9bea..b46182036c2c2271649b13ebc37615d62a550b67 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -36,6 +36,7 @@
#include "chrome/browser/io_thread.h"
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/browser/metrics/thread_watcher.h"
+#include "chrome/browser/metrics/variations_service.h"
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/net/crl_set_fetcher.h"
#include "chrome/browser/net/sdch_dictionary_fetcher.h"
@@ -128,6 +129,7 @@ BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line)
created_local_state_(false),
created_icon_manager_(false),
created_browser_policy_connector_(false),
+ created_variations_service_(false),
created_notification_ui_manager_(false),
created_safe_browsing_service_(false),
module_ref_count_(0),
@@ -185,13 +187,14 @@ void BrowserProcessImpl::StartTearDown() {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&SdchDictionaryFetcher::Shutdown));
- // We need to destroy the MetricsService, IntranetRedirectDetector, and
- // SafeBrowsing ClientSideDetectionService (owned by the SafeBrowsingService)
- // before the io_thread_ gets destroyed, since their destructors can call the
- // URLFetcher destructor, which does a PostDelayedTask operation on the IO
- // thread. (The IO thread will handle that URLFetcher operation before going
- // away.)
+ // We need to destroy the MetricsService, VariationsService,
+ // IntranetRedirectDetector, and SafeBrowsing ClientSideDetectionService
+ // (owned by the SafeBrowsingService) before the io_thread_ gets destroyed,
+ // since their destructors can call the URLFetcher destructor, which does a
+ // PostDelayedTask operation on the IO thread. (The IO thread will handle that
+ // URLFetcher operation before going away.)
metrics_service_.reset();
+ variations_service_.reset();
intranet_redirect_detector_.reset();
#if defined(ENABLE_SAFE_BROWSING)
if (safe_browsing_service_.get()) {
@@ -395,6 +398,13 @@ net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() {
return io_thread()->system_url_request_context_getter();
}
+VariationsService* BrowserProcessImpl::variations_service() {
+ DCHECK(CalledOnValidThread());
+ if (!created_variations_service_)
+ CreateVariationsService();
+ return variations_service_.get();
+}
+
#if defined(OS_CHROMEOS)
chromeos::OomPriorityManager* BrowserProcessImpl::oom_priority_manager() {
DCHECK(CalledOnValidThread());
@@ -738,6 +748,13 @@ void BrowserProcessImpl::CreateLocalState() {
local_state_->RegisterBooleanPref(prefs::kAllowCrossOriginAuthPrompt, false);
}
+void BrowserProcessImpl::CreateVariationsService() {
+ DCHECK(!created_variations_service_ && variations_service_.get() == NULL);
+ created_variations_service_ = true;
+
+ variations_service_.reset(new VariationsService);
+}
+
void BrowserProcessImpl::PreCreateThreads() {
io_thread_.reset(new IOThread(
local_state(), net_log_.get(), extension_event_router_forwarder_.get()));

Powered by Google App Engine
This is Rietveld 408576698