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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.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/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc
index 22d7cf89e39caaf91e4c1797d0121d5757a4c4ac..75740480b0b98e0a24f86e33129857169ff7e472 100644
--- a/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc
@@ -56,7 +56,7 @@ const int kFakeRenderProcessId = 123;
// 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.
@@ -66,21 +66,21 @@ KeyedService* BuildHistoryService(content::BrowserContext* context) {
base::PathExists(history_path)) {
ADD_FAILURE() << "failed to delete history db file "
<< history_path.value();
- return NULL;
+ return scoped_ptr<KeyedService>();
sky 2015/06/08 20:18:49 nullptr (and 83).
Ilya Sherman 2015/06/08 22:11:43 Done.
}
- 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 scoped_ptr<KeyedService>();
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698