Bug 1632099 - P1. Have nsQueryObject accept const smart pointers. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D80385
This commit is contained in:
Jean-Yves Avenard 2020-06-22 14:42:16 +00:00
parent 34be3870be
commit fadd7f165d

View File

@ -61,12 +61,12 @@ inline nsQueryObject<T> do_QueryObject(T* aRawPtr) {
}
template <class T>
inline nsQueryObject<T> do_QueryObject(nsCOMPtr<T>& aRawPtr) {
inline nsQueryObject<T> do_QueryObject(const nsCOMPtr<T>& aRawPtr) {
return nsQueryObject<T>(aRawPtr);
}
template <class T>
inline nsQueryObject<T> do_QueryObject(RefPtr<T>& aRawPtr) {
inline nsQueryObject<T> do_QueryObject(const RefPtr<T>& aRawPtr) {
return nsQueryObject<T>(aRawPtr);
}
@ -77,13 +77,13 @@ inline nsQueryObjectWithError<T> do_QueryObject(T* aRawPtr,
}
template <class T>
inline nsQueryObjectWithError<T> do_QueryObject(nsCOMPtr<T>& aRawPtr,
inline nsQueryObjectWithError<T> do_QueryObject(const nsCOMPtr<T>& aRawPtr,
nsresult* aErrorPtr) {
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
}
template <class T>
inline nsQueryObjectWithError<T> do_QueryObject(RefPtr<T>& aRawPtr,
inline nsQueryObjectWithError<T> do_QueryObject(const RefPtr<T>& aRawPtr,
nsresult* aErrorPtr) {
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
}