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

Side by Side Diff: base/process_posix.cc

Issue 6385003: Properly order the cc files based off the h files in base/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/process_util.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 (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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.h" 5 #include "base/process.h"
6 6
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <sys/time.h> 8 #include <sys/time.h>
9 #include <sys/resource.h> 9 #include <sys/resource.h>
10 10
11 #include "base/process_util.h" 11 #include "base/process_util.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 // static
17 Process Process::Current() {
18 return Process(GetCurrentProcessHandle());
19 }
20
21 ProcessId Process::pid() const {
22 if (process_ == 0)
23 return 0;
24
25 return GetProcId(process_);
26 }
27
28 bool Process::is_current() const {
29 return process_ == GetCurrentProcessHandle();
30 }
31
16 void Process::Close() { 32 void Process::Close() {
17 process_ = 0; 33 process_ = 0;
18 // if the process wasn't terminated (so we waited) or the state 34 // if the process wasn't terminated (so we waited) or the state
19 // wasn't already collected w/ a wait from process_utils, we're gonna 35 // wasn't already collected w/ a wait from process_utils, we're gonna
20 // end up w/ a zombie when it does finally exit. 36 // end up w/ a zombie when it does finally exit.
21 } 37 }
22 38
23 void Process::Terminate(int result_code) { 39 void Process::Terminate(int result_code) {
24 // result_code isn't supportable. 40 // result_code isn't supportable.
25 if (!process_) 41 if (!process_)
(...skipping 10 matching lines...) Expand all
36 } 52 }
37 53
38 bool Process::SetProcessBackgrounded(bool value) { 54 bool Process::SetProcessBackgrounded(bool value) {
39 // POSIX only allows lowering the priority of a process, so if we 55 // POSIX only allows lowering the priority of a process, so if we
40 // were to lower it we wouldn't be able to raise it back to its initial 56 // were to lower it we wouldn't be able to raise it back to its initial
41 // priority. 57 // priority.
42 return false; 58 return false;
43 } 59 }
44 #endif 60 #endif
45 61
46 ProcessId Process::pid() const {
47 if (process_ == 0)
48 return 0;
49
50 return GetProcId(process_);
51 }
52
53 bool Process::is_current() const {
54 return process_ == GetCurrentProcessHandle();
55 }
56
57 // static
58 Process Process::Current() {
59 return Process(GetCurrentProcessHandle());
60 }
61
62 int Process::GetPriority() const { 62 int Process::GetPriority() const {
63 DCHECK(process_); 63 DCHECK(process_);
64 return getpriority(PRIO_PROCESS, process_); 64 return getpriority(PRIO_PROCESS, process_);
65 } 65 }
66 66
67 } // namspace base 67 } // namspace base
OLDNEW
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/process_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698