| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 | 9 |
| 10 namespace base { | 10 namespace base { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 | 101 |
| 102 bool Process::EmptyWorkingSet() { | 102 bool Process::EmptyWorkingSet() { |
| 103 if (!process_) | 103 if (!process_) |
| 104 return false; | 104 return false; |
| 105 | 105 |
| 106 BOOL rv = SetProcessWorkingSetSize(process_, -1, -1); | 106 BOOL rv = SetProcessWorkingSetSize(process_, -1, -1); |
| 107 return rv == TRUE; | 107 return rv == TRUE; |
| 108 } | 108 } |
| 109 | 109 |
| 110 int32 Process::pid() const { | 110 ProcessId Process::pid() const { |
| 111 if (process_ == 0) | 111 if (process_ == 0) |
| 112 return 0; | 112 return 0; |
| 113 | 113 |
| 114 return GetProcId(process_); | 114 return GetProcId(process_); |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool Process::is_current() const { | 117 bool Process::is_current() const { |
| 118 return process_ == GetCurrentProcess(); | 118 return process_ == GetCurrentProcess(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 // static | 121 // static |
| 122 Process Process::Current() { | 122 Process Process::Current() { |
| 123 return Process(GetCurrentProcess()); | 123 return Process(GetCurrentProcess()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace base | 126 } // namespace base |
| OLD | NEW |