| 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_WIN_SCOPED_COMPTR_H_ | 5 #ifndef BASE_WIN_SCOPED_COMPTR_H_ |
| 6 #define BASE_WIN_SCOPED_COMPTR_H_ | 6 #define BASE_WIN_SCOPED_COMPTR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <unknwn.h> | 9 #include <unknwn.h> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 namespace win { | 15 namespace win { |
| 16 | 16 |
| 17 // A fairly minimalistic smart class for COM interface pointers. | 17 // A fairly minimalistic smart class for COM interface pointers. |
| 18 // Uses scoped_refptr for the basic smart pointer functionality | 18 // Uses scoped_refptr for the basic smart pointer functionality |
| 19 // and adds a few IUnknown specific services. | 19 // and adds a few IUnknown specific services. |
| 20 template <class Interface, const IID* interface_id = &__uuidof(Interface)> | 20 template <class Interface, const IID* interface_id = &__uuidof(Interface)> |
| 21 class ScopedComPtr : public scoped_refptr<Interface> { | 21 class ScopedComPtr : public scoped_refptr<Interface> { |
| 22 public: | 22 public: |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 static const IID& iid() { | 161 static const IID& iid() { |
| 162 return *interface_id; | 162 return *interface_id; |
| 163 } | 163 } |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 } // namespace win | 166 } // namespace win |
| 167 } // namespace base | 167 } // namespace base |
| 168 | 168 |
| 169 #endif // BASE_WIN_SCOPED_COMPTR_H_ | 169 #endif // BASE_WIN_SCOPED_COMPTR_H_ |
| OLD | NEW |