| Index: base/scoped_comptr_win.h
|
| ===================================================================
|
| --- base/scoped_comptr_win.h (revision 8298)
|
| +++ base/scoped_comptr_win.h (working copy)
|
| @@ -12,13 +12,13 @@
|
|
|
| // Utility template to prevent users of ScopedComPtr from calling AddRef and/or
|
| // Release() without going through the ScopedComPtr class.
|
| -template <class Interface>
|
| -class BlockIUnknownMethods : public Interface {
|
| - private:
|
| +template <class Interface>
|
| +class BlockIUnknownMethods : public Interface {
|
| + private:
|
| STDMETHOD(QueryInterface)(REFIID iid, void** object) = 0;
|
| - STDMETHOD_(ULONG, AddRef)() = 0;
|
| - STDMETHOD_(ULONG, Release)() = 0;
|
| -};
|
| + STDMETHOD_(ULONG, AddRef)() = 0;
|
| + STDMETHOD_(ULONG, Release)() = 0;
|
| +};
|
|
|
| // A fairly minimalistic smart class for COM interface pointers.
|
| // Uses scoped_refptr for the basic smart pointer functionality
|
| @@ -109,18 +109,18 @@
|
| bool IsSameObject(IUnknown* other) {
|
| if (!other && !ptr_)
|
| return true;
|
| -
|
| - if (!other || !ptr_)
|
| - return false;
|
| -
|
| - ScopedComPtr<IUnknown> my_identity;
|
| - QueryInterface(my_identity.Receive());
|
| -
|
| - ScopedComPtr<IUnknown> other_identity;
|
| - other->QueryInterface(other_identity.Receive());
|
| -
|
| - return static_cast<IUnknown*>(my_identity) ==
|
| - static_cast<IUnknown*>(other_identity);
|
| +
|
| + if (!other || !ptr_)
|
| + return false;
|
| +
|
| + ScopedComPtr<IUnknown> my_identity;
|
| + QueryInterface(my_identity.Receive());
|
| +
|
| + ScopedComPtr<IUnknown> other_identity;
|
| + other->QueryInterface(other_identity.Receive());
|
| +
|
| + return static_cast<IUnknown*>(my_identity) ==
|
| + static_cast<IUnknown*>(other_identity);
|
| }
|
|
|
| // Provides direct access to the interface.
|
|
|