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

Unified Diff: chrome/browser/ui/app_list/app_list_syncable_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/ui/app_list/app_list_syncable_service_factory.cc
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc b/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
index 3ef9d923ca6bddae213d09ba1007b5845567c89b..06e73ced0c0150fef475b12de916419ea9fdf335 100644
--- a/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
+++ b/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc
@@ -35,7 +35,7 @@ AppListSyncableServiceFactory* AppListSyncableServiceFactory::GetInstance() {
}
// static
-KeyedService* AppListSyncableServiceFactory::BuildInstanceFor(
+scoped_ptr<KeyedService> AppListSyncableServiceFactory::BuildInstanceFor(
content::BrowserContext* browser_context) {
Profile* profile = static_cast<Profile*>(browser_context);
#if defined(OS_CHROMEOS)
@@ -44,8 +44,8 @@ KeyedService* AppListSyncableServiceFactory::BuildInstanceFor(
#endif
VLOG(1) << "BuildInstanceFor: " << profile->GetDebugName()
<< " (" << profile << ")";
- return new AppListSyncableService(profile,
- extensions::ExtensionSystem::Get(profile));
+ return make_scoped_ptr(new AppListSyncableService(
+ profile, extensions::ExtensionSystem::Get(profile)));
}
AppListSyncableServiceFactory::AppListSyncableServiceFactory()
@@ -70,7 +70,7 @@ AppListSyncableServiceFactory::~AppListSyncableServiceFactory() {
KeyedService* AppListSyncableServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* browser_context) const {
- return BuildInstanceFor(static_cast<Profile*>(browser_context));
+ return BuildInstanceFor(static_cast<Profile*>(browser_context)).release();
}
void AppListSyncableServiceFactory::RegisterProfilePrefs(

Powered by Google App Engine
This is Rietveld 408576698