Index: chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc |
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc |
index c9d2f8ad7244091b97a86a05a5976a51924106e2..e1285114b88fd24e9f98c9de5301774adc97f670 100644 |
--- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc |
+++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc |
@@ -10,6 +10,7 @@ |
#include "base/bind.h" |
#include "base/callback.h" |
#include "base/files/file_util.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/run_loop.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
@@ -42,7 +43,7 @@ namespace { |
// A BrowserContextKeyedServiceFactory::TestingFactoryFunction that creates a |
// HistoryService for a TestingProfile. |
-KeyedService* BuildHistoryService(content::BrowserContext* context) { |
+scoped_ptr<KeyedService> BuildHistoryService(content::BrowserContext* context) { |
TestingProfile* profile = static_cast<TestingProfile*>(context); |
// Delete the file before creating the service. |
@@ -52,21 +53,21 @@ KeyedService* BuildHistoryService(content::BrowserContext* context) { |
base::PathExists(history_path)) { |
ADD_FAILURE() << "failed to delete history db file " |
<< history_path.value(); |
- return NULL; |
+ return nullptr; |
} |
- history::HistoryService* history_service = new history::HistoryService( |
- ChromeHistoryClientFactory::GetForProfile(profile), |
- scoped_ptr<history::VisitDelegate>()); |
+ scoped_ptr<history::HistoryService> history_service( |
+ new history::HistoryService( |
+ ChromeHistoryClientFactory::GetForProfile(profile), |
+ scoped_ptr<history::VisitDelegate>())); |
if (history_service->Init( |
profile->GetPrefs()->GetString(prefs::kAcceptLanguages), |
history::HistoryDatabaseParamsForPath(profile->GetPath()))) { |
- return history_service; |
+ return history_service.Pass(); |
} |
ADD_FAILURE() << "failed to initialize history service"; |
- delete history_service; |
- return NULL; |
+ return nullptr; |
} |
} // namespace |