| 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_MEMORY_SCOPED_OPEN_PROCESS_H_ | 5 #ifndef BASE_MEMORY_SCOPED_OPEN_PROCESS_H_ |
| 6 #define BASE_MEMORY_SCOPED_OPEN_PROCESS_H_ | 6 #define BASE_MEMORY_SCOPED_OPEN_PROCESS_H_ |
| 7 | 7 |
| 8 #include "base/process.h" | 8 #include "base/process/process_handle.h" |
| 9 #include "base/process_util.h" | |
| 10 | 9 |
| 11 namespace base { | 10 namespace base { |
| 12 | 11 |
| 13 // A class that opens a process from its process id and closes it when the | 12 // A class that opens a process from its process id and closes it when the |
| 14 // instance goes out of scope. | 13 // instance goes out of scope. |
| 15 class ScopedOpenProcess { | 14 class ScopedOpenProcess { |
| 16 public: | 15 public: |
| 17 ScopedOpenProcess() : handle_(kNullProcessHandle) { | 16 ScopedOpenProcess() : handle_(kNullProcessHandle) { |
| 18 } | 17 } |
| 19 | 18 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 40 | 39 |
| 41 ProcessHandle handle() const { return handle_; } | 40 ProcessHandle handle() const { return handle_; } |
| 42 | 41 |
| 43 private: | 42 private: |
| 44 ProcessHandle handle_; | 43 ProcessHandle handle_; |
| 45 DISALLOW_COPY_AND_ASSIGN(ScopedOpenProcess); | 44 DISALLOW_COPY_AND_ASSIGN(ScopedOpenProcess); |
| 46 }; | 45 }; |
| 47 } // namespace base | 46 } // namespace base |
| 48 | 47 |
| 49 #endif // BASE_MEMORY_SCOPED_OPEN_PROCESS_H_ | 48 #endif // BASE_MEMORY_SCOPED_OPEN_PROCESS_H_ |
| OLD | NEW |