OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_COMPTR_WIN_H_ | 5 #ifndef BASE_SCOPED_COMPTR_WIN_H_ |
6 #define BASE_SCOPED_COMPTR_WIN_H_ | 6 #define BASE_SCOPED_COMPTR_WIN_H_ |
7 | 7 |
8 #include <unknwn.h> | 8 #include <unknwn.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // ... later the destructor runs, which will Release() again. | 131 // ... later the destructor runs, which will Release() again. |
132 // and to get the benefit of the DCHECKs we add to QueryInterface. | 132 // and to get the benefit of the DCHECKs we add to QueryInterface. |
133 // There's still a way to call these methods if you absolutely must | 133 // There's still a way to call these methods if you absolutely must |
134 // by statically casting the ScopedComPtr instance to the wrapped interface | 134 // by statically casting the ScopedComPtr instance to the wrapped interface |
135 // and then making the call... but generally that shouldn't be necessary. | 135 // and then making the call... but generally that shouldn't be necessary. |
136 BlockIUnknownMethods<Interface>* operator->() const { | 136 BlockIUnknownMethods<Interface>* operator->() const { |
137 DCHECK(ptr_ != NULL); | 137 DCHECK(ptr_ != NULL); |
138 return reinterpret_cast<BlockIUnknownMethods<Interface>*>(ptr_); | 138 return reinterpret_cast<BlockIUnknownMethods<Interface>*>(ptr_); |
139 } | 139 } |
140 | 140 |
| 141 // Pull in operator=() from the parent class. |
| 142 using scoped_refptr<Interface>::operator=; |
| 143 |
141 // static methods | 144 // static methods |
142 | 145 |
143 static const IID& iid() { | 146 static const IID& iid() { |
144 return *interface_id; | 147 return *interface_id; |
145 } | 148 } |
146 }; | 149 }; |
147 | 150 |
148 #endif // BASE_SCOPED_COMPTR_WIN_H_ | 151 #endif // BASE_SCOPED_COMPTR_WIN_H_ |
OLD | NEW |