зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1287624, part 2 - Replace swap with forget in a few places. r=froydnj
The return argument was initialized to null in all of these, so it should not change the behavior.
This commit is contained in:
Родитель
2c5b2b21f3
Коммит
41cc2c03eb
|
@ -66,8 +66,7 @@ nsInputStreamPump::Create(nsInputStreamPump **result,
|
|||
rv = pump->Init(stream, streamPos, streamLen,
|
||||
segsize, segcount, closeWhenDone);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
*result = nullptr;
|
||||
pump.swap(*result);
|
||||
pump.forget(result);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
|
|
|
@ -1506,8 +1506,6 @@ nsNavHistoryQueryOptions::Clone(nsNavHistoryQueryOptions **aResult)
|
|||
{
|
||||
*aResult = nullptr;
|
||||
nsNavHistoryQueryOptions *result = new nsNavHistoryQueryOptions();
|
||||
if (! result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
RefPtr<nsNavHistoryQueryOptions> resultHolder(result);
|
||||
result->mSort = mSort;
|
||||
|
@ -1520,7 +1518,7 @@ nsNavHistoryQueryOptions::Clone(nsNavHistoryQueryOptions **aResult)
|
|||
result->mParentAnnotationToExclude = mParentAnnotationToExclude;
|
||||
result->mAsyncEnabled = mAsyncEnabled;
|
||||
|
||||
resultHolder.swap(*aResult);
|
||||
resultHolder.forget(aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -778,7 +778,7 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
|
|||
thisContext->SetRemoteTabs(isUsingRemoteTabs);
|
||||
}
|
||||
|
||||
window.swap(*aResult); // transfer reference
|
||||
window.forget(aResult);
|
||||
if (parent)
|
||||
parent->AddChildWindow(*aResult);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче