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

Unified Diff: chrome/browser/extensions/api/sessions/sessions_apitest.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: Rebase 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/extensions/api/sessions/sessions_apitest.cc
diff --git a/chrome/browser/extensions/api/sessions/sessions_apitest.cc b/chrome/browser/extensions/api/sessions/sessions_apitest.cc
index 36c02d59bb150a365081f744d57a1e5e639bfe27..82c4cfef3532935897ebea3c048704dd387f3781 100644
--- a/chrome/browser/extensions/api/sessions/sessions_apitest.cc
+++ b/chrome/browser/extensions/api/sessions/sessions_apitest.cc
@@ -90,7 +90,7 @@ class ExtensionSessionsTest : public InProcessBrowserTest {
void SetUpOnMainThread() override;
protected:
- static KeyedService* BuildProfileSyncService(
+ static scoped_ptr<KeyedService> BuildProfileSyncService(
content::BrowserContext* profile);
void CreateTestProfileSyncService();
@@ -121,11 +121,10 @@ void ExtensionSessionsTest::SetUpOnMainThread() {
CreateTestExtension();
}
-KeyedService* ExtensionSessionsTest::BuildProfileSyncService(
+scoped_ptr<KeyedService> ExtensionSessionsTest::BuildProfileSyncService(
content::BrowserContext* profile) {
Devlin 2015/06/08 19:29:43 nit: rename
Ilya Sherman 2015/06/08 22:11:43 Done.
-
- ProfileSyncComponentsFactoryMock* factory =
- new ProfileSyncComponentsFactoryMock();
+ scoped_ptr<ProfileSyncComponentsFactoryMock> factory(
+ new ProfileSyncComponentsFactoryMock());
factory->SetLocalDeviceInfoProvider(
scoped_ptr<sync_driver::LocalDeviceInfoProvider>(
@@ -137,9 +136,8 @@ KeyedService* ExtensionSessionsTest::BuildProfileSyncService(
sync_pb::SyncEnums_DeviceType_TYPE_LINUX,
"device_id")));
- return new ProfileSyncServiceMock(
- scoped_ptr<ProfileSyncComponentsFactory>(factory),
- static_cast<Profile*>(profile));
+ return make_scoped_ptr(new ProfileSyncServiceMock(
+ factory.Pass(), static_cast<Profile*>(profile)));
}
void ExtensionSessionsTest::CreateTestProfileSyncService() {

Powered by Google App Engine
This is Rietveld 408576698