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

Unified Diff: chrome/browser/diagnostics/recon_diagnostics.cc

Issue 2442953002: Remove stl_util's deletion function use from chrome/. (Closed)
Patch Set: fix Created 4 years, 2 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
« no previous file with comments | « chrome/browser/diagnostics/recon_diagnostics.h ('k') | chrome/browser/diagnostics/sqlite_diagnostics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/diagnostics/recon_diagnostics.cc
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc
index 5874609249bfbf3290788f7f64546b7367efec6f..5b2a92b96984f3f31b46306513c1d74f36a730a2 100644
--- a/chrome/browser/diagnostics/recon_diagnostics.cc
+++ b/chrome/browser/diagnostics/recon_diagnostics.cc
@@ -14,6 +14,7 @@
#include "base/json/json_reader.h"
#include "base/json/json_string_value_serializer.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -330,55 +331,58 @@ class VersionTest : public DiagnosticsTest {
} // namespace
-DiagnosticsTest* MakeDiskSpaceTest() { return new DiskSpaceTest(); }
+std::unique_ptr<DiagnosticsTest> MakeDiskSpaceTest() {
+ return base::MakeUnique<DiskSpaceTest>();
+}
-DiagnosticsTest* MakeInstallTypeTest() { return new InstallTypeTest(); }
+std::unique_ptr<DiagnosticsTest> MakeInstallTypeTest() {
+ return base::MakeUnique<InstallTypeTest>();
+}
-DiagnosticsTest* MakeBookMarksTest() {
+std::unique_ptr<DiagnosticsTest> MakeBookMarksTest() {
base::FilePath path = DiagnosticsTest::GetUserDefaultProfileDir();
path = path.Append(bookmarks::kBookmarksFileName);
- return new JSONTest(path,
- DIAGNOSTICS_JSON_BOOKMARKS_TEST,
- 2 * kOneMegabyte,
- JSONTest::NON_CRITICAL);
+ return base::MakeUnique<JSONTest>(path, DIAGNOSTICS_JSON_BOOKMARKS_TEST,
+ 2 * kOneMegabyte, JSONTest::NON_CRITICAL);
}
-DiagnosticsTest* MakeLocalStateTest() {
+std::unique_ptr<DiagnosticsTest> MakeLocalStateTest() {
base::FilePath path;
PathService::Get(chrome::DIR_USER_DATA, &path);
path = path.Append(chrome::kLocalStateFilename);
- return new JSONTest(path,
- DIAGNOSTICS_JSON_LOCAL_STATE_TEST,
- 50 * kOneKilobyte,
- JSONTest::CRITICAL);
+ return base::MakeUnique<JSONTest>(path, DIAGNOSTICS_JSON_LOCAL_STATE_TEST,
+ 50 * kOneKilobyte, JSONTest::CRITICAL);
}
-DiagnosticsTest* MakePreferencesTest() {
+std::unique_ptr<DiagnosticsTest> MakePreferencesTest() {
base::FilePath path = DiagnosticsTest::GetUserDefaultProfileDir();
path = path.Append(chrome::kPreferencesFilename);
- return new JSONTest(path,
- DIAGNOSTICS_JSON_PREFERENCES_TEST,
- 100 * kOneKilobyte,
- JSONTest::CRITICAL);
+ return base::MakeUnique<JSONTest>(path, DIAGNOSTICS_JSON_PREFERENCES_TEST,
+ 100 * kOneKilobyte, JSONTest::CRITICAL);
}
+std::unique_ptr<DiagnosticsTest> MakeOperatingSystemTest() {
+ return base::MakeUnique<OperatingSystemTest>();
+}
-DiagnosticsTest* MakeOperatingSystemTest() { return new OperatingSystemTest(); }
-
-DiagnosticsTest* MakeDictonaryDirTest() {
- return new PathTest(kPathsToTest[0]);
+std::unique_ptr<DiagnosticsTest> MakeDictonaryDirTest() {
+ return base::MakeUnique<PathTest>(kPathsToTest[0]);
}
-DiagnosticsTest* MakeLocalStateFileTest() {
- return new PathTest(kPathsToTest[1]);
+std::unique_ptr<DiagnosticsTest> MakeLocalStateFileTest() {
+ return base::MakeUnique<PathTest>(kPathsToTest[1]);
}
-DiagnosticsTest* MakeResourcesFileTest() {
- return new PathTest(kPathsToTest[2]);
+std::unique_ptr<DiagnosticsTest> MakeResourcesFileTest() {
+ return base::MakeUnique<PathTest>(kPathsToTest[2]);
}
-DiagnosticsTest* MakeUserDirTest() { return new PathTest(kPathsToTest[3]); }
+std::unique_ptr<DiagnosticsTest> MakeUserDirTest() {
+ return base::MakeUnique<PathTest>(kPathsToTest[3]);
+}
-DiagnosticsTest* MakeVersionTest() { return new VersionTest(); }
+std::unique_ptr<DiagnosticsTest> MakeVersionTest() {
+ return base::MakeUnique<VersionTest>();
+}
} // namespace diagnostics
« no previous file with comments | « chrome/browser/diagnostics/recon_diagnostics.h ('k') | chrome/browser/diagnostics/sqlite_diagnostics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698