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

Unified Diff: chrome/browser/search_engines/template_url_service_factory.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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/search_engines/template_url_service_factory.cc
diff --git a/chrome/browser/search_engines/template_url_service_factory.cc b/chrome/browser/search_engines/template_url_service_factory.cc
index c4229d3d454c6ed3bfbec2201832a50fe95cdc04..4d6709a0dbeac96415755faced0616c8ebc5bf01 100644
--- a/chrome/browser/search_engines/template_url_service_factory.cc
+++ b/chrome/browser/search_engines/template_url_service_factory.cc
@@ -35,7 +35,7 @@ TemplateURLServiceFactory* TemplateURLServiceFactory::GetInstance() {
}
// static
-KeyedService* TemplateURLServiceFactory::BuildInstanceFor(
+scoped_ptr<KeyedService> TemplateURLServiceFactory::BuildInstanceFor(
content::BrowserContext* context) {
base::Closure dsp_change_callback;
#if defined(ENABLE_RLZ)
@@ -46,7 +46,7 @@ KeyedService* TemplateURLServiceFactory::BuildInstanceFor(
rlz_lib::SET_TO_GOOGLE);
#endif
Profile* profile = static_cast<Profile*>(context);
- return new TemplateURLService(
+ return make_scoped_ptr(new TemplateURLService(
profile->GetPrefs(),
scoped_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)),
WebDataServiceFactory::GetKeywordWebDataForProfile(
@@ -55,8 +55,7 @@ KeyedService* TemplateURLServiceFactory::BuildInstanceFor(
HistoryServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS))),
GoogleURLTrackerFactory::GetForProfile(profile),
- g_browser_process->rappor_service(),
- dsp_change_callback);
+ g_browser_process->rappor_service(), dsp_change_callback));
}
TemplateURLServiceFactory::TemplateURLServiceFactory()
@@ -72,7 +71,7 @@ TemplateURLServiceFactory::~TemplateURLServiceFactory() {}
KeyedService* TemplateURLServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
- return BuildInstanceFor(static_cast<Profile*>(profile));
+ return BuildInstanceFor(static_cast<Profile*>(profile)).release();
}
void TemplateURLServiceFactory::RegisterProfilePrefs(
« no previous file with comments | « chrome/browser/search_engines/template_url_service_factory.h ('k') | chrome/browser/services/gcm/fake_gcm_profile_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698