| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_SCOPED_OPEN_PROCESS_H_ | 5 #ifndef BASE_MEMORY_SCOPED_OPEN_PROCESS_H_ |
| 6 #define BASE_SCOPED_OPEN_PROCESS_H_ | 6 #define BASE_MEMORY_SCOPED_OPEN_PROCESS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/process.h" | 9 #include "base/process.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 | 13 |
| 14 // A class that opens a process from its process id and closes it when the | 14 // A class that opens a process from its process id and closes it when the |
| 15 // instance goes out of scope. | 15 // instance goes out of scope. |
| 16 class ScopedOpenProcess { | 16 class ScopedOpenProcess { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 38 CloseProcessHandle(handle_); | 38 CloseProcessHandle(handle_); |
| 39 handle_ = kNullProcessHandle; | 39 handle_ = kNullProcessHandle; |
| 40 } | 40 } |
| 41 | 41 |
| 42 ProcessHandle handle() const { return handle_; } | 42 ProcessHandle handle() const { return handle_; } |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 ProcessHandle handle_; | 45 ProcessHandle handle_; |
| 46 DISALLOW_COPY_AND_ASSIGN(ScopedOpenProcess); | 46 DISALLOW_COPY_AND_ASSIGN(ScopedOpenProcess); |
| 47 }; | 47 }; |
| 48 |
| 48 } // namespace base | 49 } // namespace base |
| 49 | 50 |
| 50 #endif // BASE_SCOPED_OPEN_PROCESS_H_ | 51 #endif // BASE_MEMORY_SCOPED_OPEN_PROCESS_H_ |
| OLD | NEW |