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

Unified Diff: sandbox/mac/bootstrap_sandbox.cc

Issue 1849323003: Convert //sandbox to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixup nonsfi_sandbox_unittest.cc 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 | « sandbox/mac/bootstrap_sandbox.h ('k') | sandbox/mac/bootstrap_sandbox_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/bootstrap_sandbox.cc
diff --git a/sandbox/mac/bootstrap_sandbox.cc b/sandbox/mac/bootstrap_sandbox.cc
index dee7903c171e4f8b823de12408117b5cd03d086a..4b3a1c6cce399becc09a58c5f449e248d3efd351 100644
--- a/sandbox/mac/bootstrap_sandbox.cc
+++ b/sandbox/mac/bootstrap_sandbox.cc
@@ -12,6 +12,7 @@
#include "base/mac/foundation_util.h"
#include "base/mac/mach_logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "sandbox/mac/launchd_interception_server.h"
@@ -55,9 +56,9 @@ class ScopedCallMachMsgDestroy {
} // namespace
// static
-scoped_ptr<BootstrapSandbox> BootstrapSandbox::Create() {
- scoped_ptr<BootstrapSandbox> null; // Used for early returns.
- scoped_ptr<BootstrapSandbox> sandbox(new BootstrapSandbox());
+std::unique_ptr<BootstrapSandbox> BootstrapSandbox::Create() {
+ std::unique_ptr<BootstrapSandbox> null; // Used for early returns.
+ std::unique_ptr<BootstrapSandbox> sandbox(new BootstrapSandbox());
sandbox->launchd_server_.reset(new LaunchdInterceptionServer(sandbox.get()));
// Check in with launchd to get the receive right for the server that is
@@ -143,7 +144,8 @@ void BootstrapSandbox::RegisterSandboxPolicy(
policies_.insert(std::make_pair(sandbox_policy_id, policy));
}
-scoped_ptr<PreExecDelegate> BootstrapSandbox::NewClient(int sandbox_policy_id) {
+std::unique_ptr<PreExecDelegate> BootstrapSandbox::NewClient(
+ int sandbox_policy_id) {
base::AutoLock lock(lock_);
DCHECK(policies_.find(sandbox_policy_id) != policies_.end());
@@ -156,7 +158,7 @@ scoped_ptr<PreExecDelegate> BootstrapSandbox::NewClient(int sandbox_policy_id) {
}
awaiting_processes_[token] = sandbox_policy_id;
- return make_scoped_ptr(new PreExecDelegate(server_bootstrap_name_, token));
+ return base::WrapUnique(new PreExecDelegate(server_bootstrap_name_, token));
}
void BootstrapSandbox::RevokeToken(uint64_t token) {
« no previous file with comments | « sandbox/mac/bootstrap_sandbox.h ('k') | sandbox/mac/bootstrap_sandbox_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698