From fadd7f165d6cd3cd923e7af95bc25e071110f96b Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 22 Jun 2020 14:42:16 +0000 Subject: [PATCH] Bug 1632099 - P1. Have nsQueryObject accept const smart pointers. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D80385 --- xpcom/base/nsQueryObject.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xpcom/base/nsQueryObject.h b/xpcom/base/nsQueryObject.h index ce4f632ac69e..7cfbe954ce97 100644 --- a/xpcom/base/nsQueryObject.h +++ b/xpcom/base/nsQueryObject.h @@ -61,12 +61,12 @@ inline nsQueryObject do_QueryObject(T* aRawPtr) { } template -inline nsQueryObject do_QueryObject(nsCOMPtr& aRawPtr) { +inline nsQueryObject do_QueryObject(const nsCOMPtr& aRawPtr) { return nsQueryObject(aRawPtr); } template -inline nsQueryObject do_QueryObject(RefPtr& aRawPtr) { +inline nsQueryObject do_QueryObject(const RefPtr& aRawPtr) { return nsQueryObject(aRawPtr); } @@ -77,13 +77,13 @@ inline nsQueryObjectWithError do_QueryObject(T* aRawPtr, } template -inline nsQueryObjectWithError do_QueryObject(nsCOMPtr& aRawPtr, +inline nsQueryObjectWithError do_QueryObject(const nsCOMPtr& aRawPtr, nsresult* aErrorPtr) { return nsQueryObjectWithError(aRawPtr, aErrorPtr); } template -inline nsQueryObjectWithError do_QueryObject(RefPtr& aRawPtr, +inline nsQueryObjectWithError do_QueryObject(const RefPtr& aRawPtr, nsresult* aErrorPtr) { return nsQueryObjectWithError(aRawPtr, aErrorPtr); }