Bug 1867190 - Add prefs for PHC probablities r=glandium
[gecko.git] / xpcom / base / nsCOMPtr.cpp
blobffe0cb1acd8a909ad43439e65bf5f27045119285
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsCOMPtr.h"
9 nsresult nsQueryInterfaceISupports::operator()(const nsIID& aIID,
10 void** aAnswer) const {
11 nsresult status;
12 if (mRawPtr) {
13 status = mRawPtr->QueryInterface(aIID, aAnswer);
14 } else {
15 status = NS_ERROR_NULL_POINTER;
18 return status;
21 nsresult nsQueryInterfaceISupportsWithError::operator()(const nsIID& aIID,
22 void** aAnswer) const {
23 nsresult status;
24 if (mRawPtr) {
25 status = mRawPtr->QueryInterface(aIID, aAnswer);
26 } else {
27 status = NS_ERROR_NULL_POINTER;
30 if (mErrorPtr) {
31 *mErrorPtr = status;
33 return status;