OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_PUBLIC_UTILITY_SCOPED_HANDLE_H_ |
| 6 #define MOJO_PUBLIC_UTILITY_SCOPED_HANDLE_H_ |
| 7 |
| 8 #include "mojo/public/system/core.h" |
| 9 |
| 10 namespace mojo { |
| 11 |
| 12 // Closes handle_ when deleted. |
| 13 // This probably wants tons of improvements, but those can be made as needed. |
| 14 class ScopedHandle { |
| 15 public: |
| 16 ScopedHandle(Handle handle); |
| 17 ~ScopedHandle(); |
| 18 Handle get() const { return handle_; } |
| 19 Handle Release(); |
| 20 |
| 21 private: |
| 22 Handle handle_; |
| 23 }; |
| 24 |
| 25 } // namespace mojo |
| 26 |
| 27 #endif // MOJO_PUBLIC_SYSTEM_SCOPED_HANDLE_H_ |
OLD | NEW |