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

Side by Side Diff: base/process/process_posix.cc

Issue 1407443002: Remove old C++03 move emulation code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: std::move and reflow Created 5 years 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 unified diff | Download patch
« no previous file with comments | « base/process/process.h ('k') | base/process/process_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/process/process.h" 5 #include "base/process/process.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/resource.h> 8 #include <sys/resource.h>
9 #include <sys/wait.h> 9 #include <sys/wait.h>
10 10
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } // namespace 210 } // namespace
211 211
212 namespace base { 212 namespace base {
213 213
214 Process::Process(ProcessHandle handle) : process_(handle) { 214 Process::Process(ProcessHandle handle) : process_(handle) {
215 } 215 }
216 216
217 Process::~Process() { 217 Process::~Process() {
218 } 218 }
219 219
220 Process::Process(RValue other) 220 Process::Process(Process&& other) : process_(other.process_) {
221 : process_(other.object->process_) { 221 other.Close();
222 other.object->Close();
223 } 222 }
224 223
225 Process& Process::operator=(RValue other) { 224 Process& Process::operator=(Process&& other) {
226 if (this != other.object) { 225 DCHECK_NE(this, &other);
227 process_ = other.object->process_; 226 process_ = other.process_;
228 other.object->Close(); 227 other.Close();
229 }
230 return *this; 228 return *this;
231 } 229 }
232 230
233 // static 231 // static
234 Process Process::Current() { 232 Process Process::Current() {
235 return Process(GetCurrentProcessHandle()); 233 return Process(GetCurrentProcessHandle());
236 } 234 }
237 235
238 // static 236 // static
239 Process Process::Open(ProcessId pid) { 237 Process Process::Open(ProcessId pid) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 return false; 370 return false;
373 } 371 }
374 #endif // !defined(OS_LINUX) 372 #endif // !defined(OS_LINUX)
375 373
376 int Process::GetPriority() const { 374 int Process::GetPriority() const {
377 DCHECK(IsValid()); 375 DCHECK(IsValid());
378 return getpriority(PRIO_PROCESS, process_); 376 return getpriority(PRIO_PROCESS, process_);
379 } 377 }
380 378
381 } // namespace base 379 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process.h ('k') | base/process/process_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698