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

Unified Diff: chrome/common/service_process_util.cc

Issue 1880143002: Convert chrome/common to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 | « chrome/common/service_process_util.h ('k') | chrome/common/service_process_util_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/service_process_util.cc
diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc
index cd0724bec52adab59733b0a40341dd9db99fd5d0..6092b401aa32a1c250326bdfb305938738b8c97a 100644
--- a/chrome/common/service_process_util.cc
+++ b/chrome/common/service_process_util.cc
@@ -7,6 +7,7 @@
#include <stdint.h>
#include <algorithm>
+#include <memory>
#include "base/base_switches.h"
#include "base/command_line.h"
@@ -119,7 +120,7 @@ std::string GetServiceProcessScopedVersionedName(
// Reads the named shared memory to get the shared data. Returns false if no
// matching shared memory was found.
bool GetServiceProcessData(std::string* version, base::ProcessId* pid) {
- scoped_ptr<base::SharedMemory> shared_mem_service_data;
+ std::unique_ptr<base::SharedMemory> shared_mem_service_data;
shared_mem_service_data.reset(new base::SharedMemory());
ServiceProcessSharedData* service_data = NULL;
if (shared_mem_service_data.get() &&
@@ -157,11 +158,12 @@ std::string GetServiceProcessScopedName(const std::string& append_str) {
return hex_hash + "." + append_str;
}
-scoped_ptr<base::CommandLine> CreateServiceProcessCommandLine() {
+std::unique_ptr<base::CommandLine> CreateServiceProcessCommandLine() {
base::FilePath exe_path;
PathService::Get(content::CHILD_PROCESS_EXE, &exe_path);
DCHECK(!exe_path.empty()) << "Unable to get service process binary name.";
- scoped_ptr<base::CommandLine> command_line(new base::CommandLine(exe_path));
+ std::unique_ptr<base::CommandLine> command_line(
+ new base::CommandLine(exe_path));
command_line->AppendSwitchASCII(switches::kProcessType,
switches::kServiceProcess);
@@ -256,7 +258,7 @@ bool ServiceProcessState::CreateSharedData() {
return false;
}
- scoped_ptr<base::SharedMemory> shared_mem_service_data(
+ std::unique_ptr<base::SharedMemory> shared_mem_service_data(
new base::SharedMemory());
if (!shared_mem_service_data.get())
return false;
« no previous file with comments | « chrome/common/service_process_util.h ('k') | chrome/common/service_process_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698