зеркало из https://github.com/mozilla/gecko-dev.git
don't ASSERT that it doesn't support weak references for NULL. r=pinkerton
This commit is contained in:
Родитель
af437476c2
Коммит
e2e36b3c4a
|
@ -43,18 +43,25 @@ nsQueryReferent::operator()( const nsIID& aIID, void** answer ) const
|
|||
}
|
||||
|
||||
NS_COM nsIWeakReference*
|
||||
NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
|
||||
NS_GetWeakReference( nsISupports* aInstancePtr, nsresult* aErrorPtr )
|
||||
{
|
||||
nsresult status;
|
||||
if ( !aResult )
|
||||
aResult = &status;
|
||||
nsIWeakReference* result = 0;
|
||||
|
||||
nsCOMPtr<nsISupportsWeakReference> factoryP = do_QueryInterface(aInstance, aResult);
|
||||
NS_ASSERTION(factoryP, "Did you know you were calling |NS_GetWeakReference()| on something that doesn't support weak references?");
|
||||
if ( aInstancePtr )
|
||||
{
|
||||
nsCOMPtr<nsISupportsWeakReference> factoryPtr = do_QueryInterface(aInstancePtr, &status);
|
||||
NS_ASSERTION(factoryPtr, "Did you know you were calling |NS_GetWeakReference()| on something that doesn't support weak references?");
|
||||
if ( factoryPtr )
|
||||
status = factoryPtr->GetWeakReference(&result);
|
||||
// else, |status| has already been set by |do_QueryInterface|
|
||||
}
|
||||
else
|
||||
status = NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsIWeakReference* weakP = 0;
|
||||
status = factoryP ? factoryP->GetWeakReference(&weakP) : NS_ERROR_NO_INTERFACE;
|
||||
return weakP;
|
||||
if ( aErrorPtr )
|
||||
*aErrorPtr = status;
|
||||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -43,18 +43,25 @@ nsQueryReferent::operator()( const nsIID& aIID, void** answer ) const
|
|||
}
|
||||
|
||||
NS_COM nsIWeakReference*
|
||||
NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
|
||||
NS_GetWeakReference( nsISupports* aInstancePtr, nsresult* aErrorPtr )
|
||||
{
|
||||
nsresult status;
|
||||
if ( !aResult )
|
||||
aResult = &status;
|
||||
nsIWeakReference* result = 0;
|
||||
|
||||
nsCOMPtr<nsISupportsWeakReference> factoryP = do_QueryInterface(aInstance, aResult);
|
||||
NS_ASSERTION(factoryP, "Did you know you were calling |NS_GetWeakReference()| on something that doesn't support weak references?");
|
||||
if ( aInstancePtr )
|
||||
{
|
||||
nsCOMPtr<nsISupportsWeakReference> factoryPtr = do_QueryInterface(aInstancePtr, &status);
|
||||
NS_ASSERTION(factoryPtr, "Did you know you were calling |NS_GetWeakReference()| on something that doesn't support weak references?");
|
||||
if ( factoryPtr )
|
||||
status = factoryPtr->GetWeakReference(&result);
|
||||
// else, |status| has already been set by |do_QueryInterface|
|
||||
}
|
||||
else
|
||||
status = NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsIWeakReference* weakP = 0;
|
||||
status = factoryP ? factoryP->GetWeakReference(&weakP) : NS_ERROR_NO_INTERFACE;
|
||||
return weakP;
|
||||
if ( aErrorPtr )
|
||||
*aErrorPtr = status;
|
||||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче