summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsdefresne <sdefresne@chromium.org>2014-10-16 07:41:51 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-16 14:42:09 +0000
commit15a8709fe24ebb55e15ed88b306d76ad72412931 (patch)
tree0a0a20f8f07df712cde7dfa4857b609d6bd3ef03
parent3e28946a9edc2d794a894a6a4a0be965f8b62761 (diff)
downloadchromium_src-15a8709fe24ebb55e15ed88b306d76ad72412931.zip
chromium_src-15a8709fe24ebb55e15ed88b306d76ad72412931.tar.gz
chromium_src-15a8709fe24ebb55e15ed88b306d76ad72412931.tar.bz2
Add missing dependency on TemplateURLService from PrefMetricsService
There is an indirect dependency from PrefMetricsService on TemplateURLService that cause an incorrect ordering of the factories instantiation when using a TestingProfile, as can be seen in the following callstack: TemplateURLServiceFactory::GetForProfile(Profile*) chrome::(anonymous namespace)::GetDefaultSearchProviderTemplateURL(Profile*) chrome::(anonymous namespace)::NewTabURLDetails::ForProfile(Profile*)1 chrome::HandleNewTabURLRewrite(GURL*, content::BrowserContext*) content::BrowserURLHandlerImpl::RewriteURLIfNecessary(GURL*, content::BrowserContext*, bool*) (anonymous namespace)::SampleNewTabPageURL(Profile*) PrefMetricsService::RecordLaunchPrefs() PrefMetricsService::PrefMetricsService(Profile*) PrefMetricsService::Factory::BuildServiceInstanceFor(content::BrowserContext*) Add an explicit dependency to fix the ordering. BUG=373326 Review URL: https://codereview.chromium.org/659973002 Cr-Commit-Position: refs/heads/master@{#299890}
-rw-r--r--chrome/browser/prefs/pref_metrics_service.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome/browser/prefs/pref_metrics_service.cc b/chrome/browser/prefs/pref_metrics_service.cc
index 4b19849..d5b67d3 100644
--- a/chrome/browser/prefs/pref_metrics_service.cc
+++ b/chrome/browser/prefs/pref_metrics_service.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/prefs/synced_pref_change_registrar.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/tabs/pinned_tab_codec.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -223,6 +224,7 @@ PrefMetricsService::Factory::Factory()
: BrowserContextKeyedServiceFactory(
"PrefMetricsService",
BrowserContextDependencyManager::GetInstance()) {
+ DependsOn(TemplateURLServiceFactory::GetInstance());
}
PrefMetricsService::Factory::~Factory() {