summaryrefslogtreecommitdiffstats
path: root/base/scoped_comptr_win.h
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 23:55:02 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 23:55:02 +0000
commitc71b654ff294d084ab7e3f24559867cf729f37b8 (patch)
tree8ed26d542965497618149fa22d526d465c7aaf08 /base/scoped_comptr_win.h
parentd9db9154512aa5966215592069490d1d39e88c9e (diff)
downloadchromium_src-c71b654ff294d084ab7e3f24559867cf729f37b8.zip
chromium_src-c71b654ff294d084ab7e3f24559867cf729f37b8.tar.gz
chromium_src-c71b654ff294d084ab7e3f24559867cf729f37b8.tar.bz2
Remove ATL from wmi_util
- CComptr and CComBstr gone, baby gone - scoped_comptr_win.h file had a CRLF or at least VC thinks so - Future work: Grow variant helper class to be really helpful - Unit tests already exist It seems base is now free of ATL Review URL: http://codereview.chromium.org/18610 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/scoped_comptr_win.h')
-rw-r--r--base/scoped_comptr_win.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/base/scoped_comptr_win.h b/base/scoped_comptr_win.h
index 8f677a0..d627223 100644
--- a/base/scoped_comptr_win.h
+++ b/base/scoped_comptr_win.h
@@ -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 @@ class ScopedComPtr : public scoped_refptr<Interface> {
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.