| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef BASE_PROCESS_H_ | 5 #ifndef BASE_PROCESS_H_ |
| 6 #define BASE_PROCESS_H_ | 6 #define BASE_PROCESS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/base_api.h" | 9 #include "base/base_export.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #include <sys/types.h> | 13 #include <sys/types.h> |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 #include <windows.h> | 15 #include <windows.h> |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 | 19 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 33 const ProcessHandle kNullProcessHandle = 0; | 33 const ProcessHandle kNullProcessHandle = 0; |
| 34 const ProcessId kNullProcessId = 0; | 34 const ProcessId kNullProcessId = 0; |
| 35 #endif // defined(OS_WIN) | 35 #endif // defined(OS_WIN) |
| 36 | 36 |
| 37 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 37 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 38 // saved_priority_ will be set to this to indicate that it's not holding | 38 // saved_priority_ will be set to this to indicate that it's not holding |
| 39 // a valid value. -20 to 19 are valid process priorities. | 39 // a valid value. -20 to 19 are valid process priorities. |
| 40 const int kUnsetProcessPriority = 256; | 40 const int kUnsetProcessPriority = 256; |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 class BASE_API Process { | 43 class BASE_EXPORT Process { |
| 44 public: | 44 public: |
| 45 Process() : process_(kNullProcessHandle) { | 45 Process() : process_(kNullProcessHandle) { |
| 46 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 46 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 47 saved_priority_ = kUnsetProcessPriority; | 47 saved_priority_ = kUnsetProcessPriority; |
| 48 #endif | 48 #endif |
| 49 } | 49 } |
| 50 | 50 |
| 51 explicit Process(ProcessHandle handle) : process_(handle) { | 51 explicit Process(ProcessHandle handle) : process_(handle) { |
| 52 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 52 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 53 saved_priority_ = kUnsetProcessPriority; | 53 saved_priority_ = kUnsetProcessPriority; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 101 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 102 // Holds the priority that the process was set to when it was backgrounded. | 102 // Holds the priority that the process was set to when it was backgrounded. |
| 103 // If the process wasn't backgrounded it will be kUnsetProcessPriority. | 103 // If the process wasn't backgrounded it will be kUnsetProcessPriority. |
| 104 int saved_priority_; | 104 int saved_priority_; |
| 105 #endif | 105 #endif |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace base | 108 } // namespace base |
| 109 | 109 |
| 110 #endif // BASE_PROCESS_H_ | 110 #endif // BASE_PROCESS_H_ |
| OLD | NEW |