Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2883)

Unified Diff: base/scoped_comptr_win.h

Issue 18610: Remove ATL from wmi_util... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/wmi_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | base/wmi_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698