Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BASE_WIN_IUNKNOWN_IMPL_H_ | |
| 6 #define BASE_WIN_IUNKNOWN_IMPL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <unknwn.h> | |
| 10 | |
| 11 #include "base/atomic_ref_count.h" | |
| 12 #include "base/base_export.h" | |
| 13 #include "base/compiler_specific.h" | |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 | |
| 16 namespace base { | |
| 17 namespace win { | |
| 18 | |
| 19 // An base implementation of IUnknown, for other classes to derive from. | |
|
M-A Ruel
2011/11/29 20:28:32
// IUnknown implementation for other classes to de
dmazzoni
2011/11/29 21:55:00
Done.
| |
| 20 class BASE_EXPORT IUnknownImpl : public IUnknown { | |
| 21 public: | |
| 22 IUnknownImpl(); | |
| 23 | |
| 24 virtual ULONG STDMETHODCALLTYPE AddRef() OVERRIDE; | |
| 25 virtual ULONG STDMETHODCALLTYPE Release() OVERRIDE; | |
| 26 | |
| 27 // Subclasses should extend this to return any interfaces they provide. | |
| 28 virtual STDMETHODIMP QueryInterface(REFIID riid, void** ppv) OVERRIDE; | |
| 29 | |
| 30 protected: | |
| 31 virtual ~IUnknownImpl(); | |
| 32 | |
| 33 private: | |
| 34 AtomicRefCount ref_count_; | |
| 35 }; | |
| 36 | |
| 37 } // namespace win | |
| 38 } // namespace base | |
| 39 | |
| 40 #endif // BASE_WIN_IUNKNOWN_IMPL_H_ | |
| OLD | NEW |