summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-12-02 17:49:40 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-03 01:50:51 +0000
commite3de838f5daa700732b05f037e5c08acdec2ffdb (patch)
tree2725a7615bd29f90aad652ebfd3d0137f427433d
parent171d73bd7d6bd45cb6611d2cd987e5be6fa878bf (diff)
downloadchromium_src-e3de838f5daa700732b05f037e5c08acdec2ffdb.zip
chromium_src-e3de838f5daa700732b05f037e5c08acdec2ffdb.tar.gz
chromium_src-e3de838f5daa700732b05f037e5c08acdec2ffdb.tar.bz2
Change callers of ScopedGeneric::Pass() to std::move()
R=Nico BUG=557422 Review URL: https://codereview.chromium.org/1467413007 Cr-Commit-Position: refs/heads/master@{#362853}
-rw-r--r--components/nacl/browser/nacl_process_host.cc2
-rw-r--r--components/nacl/loader/nonsfi/nonsfi_sandbox.cc2
-rw-r--r--components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc2
-rw-r--r--content/browser/child_process_launcher.cc16
-rw-r--r--content/browser/file_descriptor_info_impl.cc6
-rw-r--r--content/browser/file_descriptor_info_impl_unittest.cc3
-rw-r--r--content/browser/gpu/gpu_process_host.cc4
-rw-r--r--content/browser/plugin_process_host.cc5
-rw-r--r--content/browser/ppapi_plugin_process_host.cc3
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc3
-rw-r--r--content/browser/utility_process_host_impl.cc4
-rw-r--r--content/common/gpu/gpu_channel.cc2
-rw-r--r--content/common/sandbox_linux/sandbox_init_linux.cc4
-rw-r--r--content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc8
-rw-r--r--content/zygote/zygote_linux.cc13
-rw-r--r--ipc/ipc_channel_posix.cc3
-rw-r--r--ipc/ipc_platform_file_attachment_posix.cc5
-rw-r--r--mojo/runner/host/linux_sandbox.cc3
-rw-r--r--sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc3
-rw-r--r--sandbox/linux/services/proc_util.cc2
-rw-r--r--sandbox/linux/syscall_broker/broker_client.cc6
-rw-r--r--sandbox/linux/syscall_broker/broker_host.cc6
-rw-r--r--sandbox/linux/syscall_broker/broker_process.cc5
23 files changed, 62 insertions, 48 deletions
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 7a82df4..5b6cb44 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -180,7 +180,7 @@ class NaClSandboxedProcessLauncherDelegate
}
#elif defined(OS_POSIX)
bool ShouldUseZygote() override { return true; }
- base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); }
+ base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
private:
diff --git a/components/nacl/loader/nonsfi/nonsfi_sandbox.cc b/components/nacl/loader/nonsfi/nonsfi_sandbox.cc
index 20ed046..cf88074 100644
--- a/components/nacl/loader/nonsfi/nonsfi_sandbox.cc
+++ b/components/nacl/loader/nonsfi/nonsfi_sandbox.cc
@@ -332,7 +332,7 @@ bool InitializeBPFSandbox(base::ScopedFD proc_fd) {
bool sandbox_is_initialized = content::InitializeSandbox(
scoped_ptr<sandbox::bpf_dsl::Policy>(
new nacl::nonsfi::NaClNonSfiBPFSandboxPolicy()),
- proc_fd.Pass());
+ std::move(proc_fd));
if (!sandbox_is_initialized)
return false;
RunSandboxSanityChecks();
diff --git a/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc b/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc
index 3b3cf9d..e4d3c70 100644
--- a/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc
+++ b/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc
@@ -187,7 +187,7 @@ void NaClSandbox::InitializeLayerTwoSandbox(bool uses_nonsfi_mode) {
// will prevent its usage.
#if defined(OS_NACL_NONSFI)
CHECK(uses_nonsfi_mode);
- layer_two_enabled_ = nacl::nonsfi::InitializeBPFSandbox(proc_fd_.Pass());
+ layer_two_enabled_ = nacl::nonsfi::InitializeBPFSandbox(std::move(proc_fd_));
layer_two_is_nonsfi_ = true;
#else
CHECK(!uses_nonsfi_mode);
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index 6b71c84..c705b7db 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -4,6 +4,8 @@
#include "content/browser/child_process_launcher.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
@@ -139,7 +141,7 @@ void LaunchOnLauncherThread(const NotifyCallback& callback,
#if defined(OS_ANDROID)
files_to_register->Share(kPrimaryIPCChannel, ipcfd.get());
#else
- files_to_register->Transfer(kPrimaryIPCChannel, ipcfd.Pass());
+ files_to_register->Transfer(kPrimaryIPCChannel, std::move(ipcfd));
#endif
#endif
@@ -188,7 +190,7 @@ void LaunchOnLauncherThread(const NotifyCallback& callback,
CHECK(!cmd_line->HasSwitch(switches::kSingleProcess));
StartChildProcess(
- cmd_line->argv(), child_process_id, files_to_register.Pass(), regions,
+ cmd_line->argv(), child_process_id, std::move(files_to_register), regions,
base::Bind(&OnChildProcessStartedAndroid, callback, client_thread_id,
begin_launch_time, base::Passed(&ipcfd)));
@@ -199,7 +201,7 @@ void LaunchOnLauncherThread(const NotifyCallback& callback,
#if !defined(OS_MACOSX)
if (use_zygote) {
base::ProcessHandle handle = ZygoteHostImpl::GetInstance()->ForkRequest(
- cmd_line->argv(), files_to_register.Pass(), process_type);
+ cmd_line->argv(), std::move(files_to_register), process_type);
process = base::Process(handle);
} else
// Fall through to the normal posix case below when we're not zygoting.
@@ -305,7 +307,7 @@ void TerminateOnLauncherThread(bool zygote, base::Process process) {
ZygoteHostImpl::GetInstance()->EnsureProcessTerminated(process.Handle());
} else
#endif // !OS_MACOSX
- base::EnsureProcessTerminated(process.Pass());
+ base::EnsureProcessTerminated(std::move(process));
#endif // OS_POSIX
#endif // defined(OS_ANDROID)
}
@@ -447,9 +449,9 @@ void ChildProcessLauncher::DidLaunch(
if (instance.get()) {
instance->Notify(zygote,
#if defined(OS_ANDROID)
- ipcfd.Pass(),
+ std::move(ipcfd),
#endif
- process.Pass());
+ std::move(process));
} else {
if (process.IsValid() && terminate_on_shutdown) {
// On Posix, EnsureProcessTerminated can lead to 2 seconds of sleep! So
@@ -469,7 +471,7 @@ void ChildProcessLauncher::Notify(
base::Process process) {
DCHECK(CalledOnValidThread());
starting_ = false;
- process_ = process.Pass();
+ process_ = std::move(process);
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
zygote_ = zygote;
diff --git a/content/browser/file_descriptor_info_impl.cc b/content/browser/file_descriptor_info_impl.cc
index 45ce542..c6cf831 100644
--- a/content/browser/file_descriptor_info_impl.cc
+++ b/content/browser/file_descriptor_info_impl.cc
@@ -4,6 +4,8 @@
#include "content/browser/file_descriptor_info_impl.h"
+#include <utility>
+
namespace content {
// static
@@ -23,7 +25,7 @@ void FileDescriptorInfoImpl::Share(int id, base::PlatformFile fd) {
void FileDescriptorInfoImpl::Transfer(int id, base::ScopedFD fd) {
AddToMapping(id, fd.get());
- owned_descriptors_.push_back(new base::ScopedFD(fd.Pass()));
+ owned_descriptors_.push_back(new base::ScopedFD(std::move(fd)));
}
base::PlatformFile FileDescriptorInfoImpl::GetFDAt(size_t i) const {
@@ -65,7 +67,7 @@ base::ScopedFD FileDescriptorInfoImpl::ReleaseFD(base::PlatformFile file) {
(*found)->swap(fd);
owned_descriptors_.erase(found);
- return fd.Pass();
+ return fd;
}
void FileDescriptorInfoImpl::AddToMapping(int id, base::PlatformFile fd) {
diff --git a/content/browser/file_descriptor_info_impl_unittest.cc b/content/browser/file_descriptor_info_impl_unittest.cc
index 9724a7c..ccc061a 100644
--- a/content/browser/file_descriptor_info_impl_unittest.cc
+++ b/content/browser/file_descriptor_info_impl_unittest.cc
@@ -6,6 +6,7 @@
#include <fcntl.h>
#include <unistd.h>
+#include <utility>
#include "base/basictypes.h"
#include "base/posix/eintr_wrapper.h"
@@ -43,7 +44,7 @@ TEST_F(FileDescriptorInfoTest, Transfer) {
base::ScopedFD fd(GetSafeFd());
int raw_fd = fd.get();
- target->Transfer(testingId, fd.Pass());
+ target->Transfer(testingId, std::move(fd));
ASSERT_EQ(1U, target->GetMappingSize());
ASSERT_EQ(target->GetFDAt(0), raw_fd);
ASSERT_EQ(target->GetIDAt(0), testingId);
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index ced0ab6..370da12 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -4,6 +4,8 @@
#include "content/browser/gpu/gpu_process_host.h"
+#include <utility>
+
#include "base/base64.h"
#include "base/base_switches.h"
#include "base/basictypes.h"
@@ -270,7 +272,7 @@ class GpuSandboxedProcessLauncherDelegate
}
#elif defined(OS_POSIX)
- base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); }
+ base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
SandboxType GetSandboxType() override {
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index ae6c3ae..8069d35 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -6,10 +6,9 @@
#if defined(OS_WIN)
#include <windows.h>
-#elif defined(OS_POSIX)
-#include <utility> // for pair<>
#endif
+#include <utility>
#include <vector>
#include "base/base_switches.h"
@@ -112,7 +111,7 @@ class PluginSandboxedProcessLauncherDelegate
}
#elif defined(OS_POSIX)
- base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); }
+ base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
private:
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 4d87474..23ce9d0 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -5,6 +5,7 @@
#include "content/browser/ppapi_plugin_process_host.h"
#include <string>
+#include <utility>
#include "base/base_switches.h"
#include "base/command_line.h"
@@ -98,7 +99,7 @@ class PpapiPluginSandboxedProcessLauncherDelegate
.GetSwitchValueNative(switches::kPpapiPluginLauncher);
return !is_broker_ && plugin_launcher.empty();
}
- base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); }
+ base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
SandboxType GetSandboxType() override {
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index eff17bc..4c2413e 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -9,6 +9,7 @@
#include <algorithm>
#include <limits>
+#include <utility>
#include <vector>
#include "base/base_switches.h"
@@ -394,7 +395,7 @@ class RendererSandboxedProcessLauncherDelegate
browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix);
return renderer_prefix.empty();
}
- base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); }
+ base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
SandboxType GetSandboxType() override { return SANDBOX_TYPE_RENDERER; }
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc
index 4e2b07c..4cd0cd1 100644
--- a/content/browser/utility_process_host_impl.cc
+++ b/content/browser/utility_process_host_impl.cc
@@ -4,6 +4,8 @@
#include "content/browser/utility_process_host_impl.h"
+#include <utility>
+
#include "base/base_switches.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -88,7 +90,7 @@ class UtilitySandboxedProcessLauncherDelegate
return !no_sandbox_ && exposed_dir_.empty();
}
base::EnvironmentMap GetEnvironment() override { return env_; }
- base::ScopedFD TakeIpcFd() override { return ipc_fd_.Pass(); }
+ base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
SandboxType GetSandboxType() override {
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index f8559b9..575dce7 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -613,7 +613,7 @@ IPC::ChannelHandle GpuChannel::Init(base::WaitableEvent* shutdown_event) {
// that it gets closed after it has been sent.
base::ScopedFD renderer_fd = channel_->TakeClientFileDescriptor();
DCHECK(renderer_fd.is_valid());
- channel_handle.socket = base::FileDescriptor(renderer_fd.Pass());
+ channel_handle.socket = base::FileDescriptor(std::move(renderer_fd));
#endif
channel_->AddFilter(filter_.get());
diff --git a/content/common/sandbox_linux/sandbox_init_linux.cc b/content/common/sandbox_linux/sandbox_init_linux.cc
index 146b352..9ffeb5d 100644
--- a/content/common/sandbox_linux/sandbox_init_linux.cc
+++ b/content/common/sandbox_linux/sandbox_init_linux.cc
@@ -4,6 +4,8 @@
#include "content/public/common/sandbox_init.h"
+#include <utility>
+
#include "base/files/scoped_file.h"
#include "base/memory/scoped_ptr.h"
#include "content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h"
@@ -14,7 +16,7 @@ namespace content {
bool InitializeSandbox(scoped_ptr<sandbox::bpf_dsl::Policy> policy,
base::ScopedFD proc_fd) {
return SandboxSeccompBPF::StartSandboxWithExternalPolicy(policy.Pass(),
- proc_fd.Pass());
+ std::move(proc_fd));
}
#if !defined(OS_NACL_NONSFI)
diff --git a/content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc b/content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc
index 79adbee..de2bcc0 100644
--- a/content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc
+++ b/content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc
@@ -70,7 +70,7 @@ void StartSandboxWithPolicy(sandbox::bpf_dsl::Policy* policy,
// doing so does not stop the sandbox.
SandboxBPF sandbox(policy);
- sandbox.SetProcFd(proc_fd.Pass());
+ sandbox.SetProcFd(std::move(proc_fd));
CHECK(sandbox.StartSandbox(SandboxBPF::SeccompLevel::SINGLE_THREADED));
}
@@ -201,7 +201,7 @@ bool StartBPFSandbox(const base::CommandLine& command_line,
}
CHECK(policy->PreSandboxHook());
- StartSandboxWithPolicy(policy.release(), proc_fd.Pass());
+ StartSandboxWithPolicy(policy.release(), std::move(proc_fd));
RunSandboxSanityChecks(process_type);
return true;
@@ -279,7 +279,7 @@ bool SandboxSeccompBPF::StartSandbox(const std::string& process_type,
// If the kernel supports the sandbox, and if the command line says we
// should enable it, enable it or die.
bool started_sandbox =
- StartBPFSandbox(command_line, process_type, proc_fd.Pass());
+ StartBPFSandbox(command_line, process_type, std::move(proc_fd));
CHECK(started_sandbox);
return true;
}
@@ -294,7 +294,7 @@ bool SandboxSeccompBPF::StartSandboxWithExternalPolicy(
#if defined(USE_SECCOMP_BPF)
if (IsSeccompBPFDesired() && SupportsSandbox()) {
CHECK(policy);
- StartSandboxWithPolicy(policy.release(), proc_fd.Pass());
+ StartSandboxWithPolicy(policy.release(), std::move(proc_fd));
return true;
}
#endif // defined(USE_SECCOMP_BPF)
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index 929527e..d582eb1 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -13,6 +13,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <utility>
#include "base/command_line.h"
#include "base/files/file_util.h"
@@ -589,7 +590,7 @@ base::ProcessId Zygote::ReadArgsAndFork(base::PickleIterator iter,
// First FD is the PID oracle socket.
if (fds.size() < 1)
return -1;
- base::ScopedFD pid_oracle(fds[0]->Pass());
+ base::ScopedFD pid_oracle(std::move(*fds[0]));
// Remaining FDs are for the global descriptor mapping.
for (int i = 1; i < numfds; ++i) {
@@ -603,13 +604,9 @@ base::ProcessId Zygote::ReadArgsAndFork(base::PickleIterator iter,
static_cast<uint32_t>(kSandboxIPCChannel), GetSandboxFD()));
// Returns twice, once per process.
- base::ProcessId child_pid = ForkWithRealPid(process_type,
- mapping,
- channel_id,
- pid_oracle.Pass(),
- uma_name,
- uma_sample,
- uma_boundary_value);
+ base::ProcessId child_pid =
+ ForkWithRealPid(process_type, mapping, channel_id, std::move(pid_oracle),
+ uma_name, uma_sample, uma_boundary_value);
if (!child_pid) {
// This is the child process.
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 1f73e78..3023c05 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -24,6 +24,7 @@
#include <algorithm>
#include <map>
#include <string>
+#include <utility>
#include "base/command_line.h"
#include "base/files/file_path.h"
@@ -544,7 +545,7 @@ base::ScopedFD ChannelPosix::TakeClientFileDescriptor() {
if (!client_pipe_.is_valid())
return base::ScopedFD();
PipeMap::GetInstance()->Remove(pipe_name_);
- return client_pipe_.Pass();
+ return std::move(client_pipe_);
}
void ChannelPosix::CloseClientFileDescriptor() {
diff --git a/ipc/ipc_platform_file_attachment_posix.cc b/ipc/ipc_platform_file_attachment_posix.cc
index b704750..b130ab2 100644
--- a/ipc/ipc_platform_file_attachment_posix.cc
+++ b/ipc/ipc_platform_file_attachment_posix.cc
@@ -4,6 +4,8 @@
#include "ipc/ipc_platform_file_attachment_posix.h"
+#include <utility>
+
namespace IPC {
namespace internal {
@@ -12,8 +14,7 @@ PlatformFileAttachment::PlatformFileAttachment(base::PlatformFile file)
}
PlatformFileAttachment::PlatformFileAttachment(base::ScopedFD file)
- : file_(file.get()), owning_(file.Pass()) {
-}
+ : file_(file.get()), owning_(std::move(file)) {}
PlatformFileAttachment::~PlatformFileAttachment() {
}
diff --git a/mojo/runner/host/linux_sandbox.cc b/mojo/runner/host/linux_sandbox.cc
index 20f7ba8..a8dcb8b 100644
--- a/mojo/runner/host/linux_sandbox.cc
+++ b/mojo/runner/host/linux_sandbox.cc
@@ -6,6 +6,7 @@
#include <fcntl.h>
#include <sys/syscall.h>
+#include <utility>
#include "base/bind.h"
#include "base/debug/leak_annotations.h"
@@ -139,7 +140,7 @@ void LinuxSandbox::EngageSeccompSandbox() {
base::ScopedFD proc_fd(HANDLE_EINTR(
openat(proc_fd_.get(), ".", O_RDONLY | O_DIRECTORY | O_CLOEXEC)));
CHECK(proc_fd.is_valid());
- sandbox.SetProcFd(proc_fd.Pass());
+ sandbox.SetProcFd(std::move(proc_fd));
CHECK(
sandbox.StartSandbox(sandbox::SandboxBPF::SeccompLevel::SINGLE_THREADED))
<< "Starting the process with a sandbox failed. Missing kernel support.";
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc
index 580cad2..2f66b40 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc
@@ -8,6 +8,7 @@
#include <unistd.h>
#include <iostream>
+#include <utility>
#include "base/files/scoped_file.h"
#include "base/posix/eintr_wrapper.h"
@@ -71,7 +72,7 @@ TEST(SandboxBPF, ProcTaskFdDescriptorGetsClosed) {
{
SandboxBPF sandbox(nullptr);
- sandbox.SetProcFd(write_end.Pass());
+ sandbox.SetProcFd(std::move(write_end));
}
ASSERT_EQ(0, fcntl(read_end.get(), F_SETFL, O_NONBLOCK));
diff --git a/sandbox/linux/services/proc_util.cc b/sandbox/linux/services/proc_util.cc
index 8341b4a..247c29c 100644
--- a/sandbox/linux/services/proc_util.cc
+++ b/sandbox/linux/services/proc_util.cc
@@ -33,7 +33,7 @@ base::ScopedFD OpenDirectory(const char* path) {
base::ScopedFD directory_fd(
HANDLE_EINTR(open(path, O_RDONLY | O_DIRECTORY | O_CLOEXEC)));
PCHECK(directory_fd.is_valid());
- return directory_fd.Pass();
+ return directory_fd;
}
} // namespace
diff --git a/sandbox/linux/syscall_broker/broker_client.cc b/sandbox/linux/syscall_broker/broker_client.cc
index 760cf59..db8201a 100644
--- a/sandbox/linux/syscall_broker/broker_client.cc
+++ b/sandbox/linux/syscall_broker/broker_client.cc
@@ -9,6 +9,7 @@
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/types.h>
+#include <utility>
#include "build/build_config.h"
#include "base/logging.h"
@@ -123,10 +124,9 @@ BrokerClient::BrokerClient(const BrokerPolicy& broker_policy,
bool fast_check_in_client,
bool quiet_failures_for_tests)
: broker_policy_(broker_policy),
- ipc_channel_(ipc_channel.Pass()),
+ ipc_channel_(std::move(ipc_channel)),
fast_check_in_client_(fast_check_in_client),
- quiet_failures_for_tests_(quiet_failures_for_tests) {
-}
+ quiet_failures_for_tests_(quiet_failures_for_tests) {}
BrokerClient::~BrokerClient() {
}
diff --git a/sandbox/linux/syscall_broker/broker_host.cc b/sandbox/linux/syscall_broker/broker_host.cc
index 8b78b1b..1a0568f 100644
--- a/sandbox/linux/syscall_broker/broker_host.cc
+++ b/sandbox/linux/syscall_broker/broker_host.cc
@@ -13,6 +13,7 @@
#include <unistd.h>
#include <string>
+#include <utility>
#include <vector>
#include "base/files/scoped_file.h"
@@ -163,8 +164,7 @@ bool HandleRemoteCommand(const BrokerPolicy& policy,
BrokerHost::BrokerHost(const BrokerPolicy& broker_policy,
BrokerChannel::EndPoint ipc_channel)
- : broker_policy_(broker_policy), ipc_channel_(ipc_channel.Pass()) {
-}
+ : broker_policy_(broker_policy), ipc_channel_(std::move(ipc_channel)) {}
BrokerHost::~BrokerHost() {
}
@@ -193,7 +193,7 @@ BrokerHost::RequestStatus BrokerHost::HandleRequest() const {
return RequestStatus::FAILURE;
}
- base::ScopedFD temporary_ipc(fds[0]->Pass());
+ base::ScopedFD temporary_ipc(std::move(*fds[0]));
base::Pickle pickle(buf, msg_len);
base::PickleIterator iter(pickle);
diff --git a/sandbox/linux/syscall_broker/broker_process.cc b/sandbox/linux/syscall_broker/broker_process.cc
index 81131cc..5ab8c6c 100644
--- a/sandbox/linux/syscall_broker/broker_process.cc
+++ b/sandbox/linux/syscall_broker/broker_process.cc
@@ -14,6 +14,7 @@
#include <algorithm>
#include <string>
+#include <utility>
#include <vector>
#include "base/callback.h"
@@ -75,7 +76,7 @@ bool BrokerProcess::Init(
// We are the parent and we have just forked our broker process.
ipc_reader.reset();
broker_pid_ = child_pid;
- broker_client_.reset(new BrokerClient(policy_, ipc_writer.Pass(),
+ broker_client_.reset(new BrokerClient(policy_, std::move(ipc_writer),
fast_check_in_client_,
quiet_failures_for_tests_));
initialized_ = true;
@@ -85,7 +86,7 @@ bool BrokerProcess::Init(
// we get notified if the client disappears.
ipc_writer.reset();
CHECK(broker_process_init_callback.Run());
- BrokerHost broker_host(policy_, ipc_reader.Pass());
+ BrokerHost broker_host(policy_, std::move(ipc_reader));
for (;;) {
switch (broker_host.HandleRequest()) {
case BrokerHost::RequestStatus::LOST_CLIENT: