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

Unified Diff: base/process/launch_posix.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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 | « base/power_monitor/power_monitor_unittest.cc ('k') | base/process/launch_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/launch_posix.cc
diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
index 4019de586fbcb155ed68d013e431e875411c86ba..c4961900381a4442f07f5ebea9a208442242814a 100644
--- a/base/process/launch_posix.cc
+++ b/base/process/launch_posix.cc
@@ -22,6 +22,7 @@
#include <iterator>
#include <limits>
+#include <memory>
#include <set>
#include "base/command_line.h"
@@ -32,7 +33,6 @@
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/posix/eintr_wrapper.h"
#include "base/process/process.h"
#include "base/process/process_metrics.h"
@@ -202,7 +202,7 @@ struct ScopedDIRClose {
};
// Automatically closes |DIR*|s.
-typedef scoped_ptr<DIR, ScopedDIRClose> ScopedDIR;
+typedef std::unique_ptr<DIR, ScopedDIRClose> ScopedDIR;
#if defined(OS_LINUX)
static const char kFDDir[] = "/proc/self/fd";
@@ -301,13 +301,13 @@ Process LaunchProcess(const std::vector<std::string>& argv,
fd_shuffle1.reserve(fd_shuffle_size);
fd_shuffle2.reserve(fd_shuffle_size);
- scoped_ptr<char* []> argv_cstr(new char* [argv.size() + 1]);
+ std::unique_ptr<char* []> argv_cstr(new char*[argv.size() + 1]);
for (size_t i = 0; i < argv.size(); i++) {
argv_cstr[i] = const_cast<char*>(argv[i].c_str());
}
argv_cstr[argv.size()] = NULL;
- scoped_ptr<char*[]> new_environ;
+ std::unique_ptr<char* []> new_environ;
char* const empty_environ = NULL;
char* const* old_environ = GetEnvironment();
if (options.clear_environ)
@@ -552,7 +552,7 @@ static GetAppOutputInternalResult GetAppOutputInternal(
int pipe_fd[2];
pid_t pid;
InjectiveMultimap fd_shuffle1, fd_shuffle2;
- scoped_ptr<char*[]> argv_cstr(new char*[argv.size() + 1]);
+ std::unique_ptr<char* []> argv_cstr(new char*[argv.size() + 1]);
fd_shuffle1.reserve(3);
fd_shuffle2.reserve(3);
« no previous file with comments | « base/power_monitor/power_monitor_unittest.cc ('k') | base/process/launch_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698