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_MAC_SCOPED_IOOBJECT_H_ | 5 #ifndef BASE_MAC_SCOPED_IOOBJECT_H_ |
6 #define BASE_MAC_SCOPED_IOOBJECT_H_ | 6 #define BASE_MAC_SCOPED_IOOBJECT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <IOKit/IOKitLib.h> | 9 #include <IOKit/IOKitLib.h> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 } | 52 } |
53 | 53 |
54 void swap(ScopedIOObject& that) { | 54 void swap(ScopedIOObject& that) { |
55 IOT temp = that.object_; | 55 IOT temp = that.object_; |
56 that.object_ = object_; | 56 that.object_ = object_; |
57 object_ = temp; | 57 object_ = temp; |
58 } | 58 } |
59 | 59 |
60 IOT release() WARN_UNUSED_RESULT { | 60 IOT release() WARN_UNUSED_RESULT { |
61 IOT temp = object_; | 61 IOT temp = object_; |
62 object_ = NULL; | 62 object_ = 0; |
Mark Mentovai
2012/03/27 21:09:59
It would be proper to use IO_OBJECT_NULL here.
| |
63 return temp; | 63 return temp; |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 IOT object_; | 67 IOT object_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(ScopedIOObject); | 69 DISALLOW_COPY_AND_ASSIGN(ScopedIOObject); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace mac | 72 } // namespace mac |
73 } // namespace base | 73 } // namespace base |
74 | 74 |
75 #endif // BASE_MAC_SCOPED_IOOBJECT_H_ | 75 #endif // BASE_MAC_SCOPED_IOOBJECT_H_ |
OLD | NEW |