From fbb1d45b16cee0e5b3b400d2ea677d765002da8e Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 23 Oct 2009 16:24:47 -0400 Subject: [PATCH] Bug 523651. Add a CallQueryInterface that works well with nsCOMPtr. r=bsmedberg --- xpcom/glue/nsCOMPtr.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xpcom/glue/nsCOMPtr.h b/xpcom/glue/nsCOMPtr.h index dc3503a33052..fb523c2671ea 100644 --- a/xpcom/glue/nsCOMPtr.h +++ b/xpcom/glue/nsCOMPtr.h @@ -1412,6 +1412,14 @@ getter_AddRefs( nsCOMPtr& aSmartPtr ) return nsGetterAddRefs(aSmartPtr); } +template +inline +nsresult +CallQueryInterface( T* aSource, nsGetterAddRefs aDestination ) +{ + return CallQueryInterface(aSource, + static_cast(aDestination)); +} // Comparing two |nsCOMPtr|s