mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 982212: Part 3 - Now that nsTArray::AppendElement supports r-value references, remove the workarounds added in Bug 967364. r=nfroyd
--HG-- extra : rebase_source : 1e6188d26b745f6dc9bdf2accc0abf7f07351510
This commit is contained in:
parent
e25a4db36c
commit
a34a3ab32d
@ -10437,8 +10437,7 @@ FullscreenRoots::Add(nsIDocument* aRoot)
|
||||
if (!sInstance) {
|
||||
sInstance = new FullscreenRoots();
|
||||
}
|
||||
nsWeakPtr weakRoot = do_GetWeakReference(aRoot);
|
||||
sInstance->mRoots.AppendElement(weakRoot);
|
||||
sInstance->mRoots.AppendElement(do_GetWeakReference(aRoot));
|
||||
}
|
||||
}
|
||||
|
||||
@ -11011,8 +11010,7 @@ nsDocument::FullScreenStackPush(Element* aElement)
|
||||
EventStateManager::SetFullScreenState(top, false);
|
||||
}
|
||||
EventStateManager::SetFullScreenState(aElement, true);
|
||||
nsWeakPtr weakElement = do_GetWeakReference(aElement);
|
||||
mFullScreenStack.AppendElement(weakElement);
|
||||
mFullScreenStack.AppendElement(do_GetWeakReference(aElement));
|
||||
NS_ASSERTION(GetFullScreenElement() == aElement, "Should match");
|
||||
return true;
|
||||
}
|
||||
|
@ -2303,7 +2303,7 @@ nsINode::GetBoundMutationObservers(nsTArray<nsRefPtr<nsDOMMutationObserver> >& a
|
||||
nsCOMPtr<nsDOMMutationObserver> mo = do_QueryInterface(objects->ObjectAt(i));
|
||||
if (mo) {
|
||||
MOZ_ASSERT(!aResult.Contains(mo));
|
||||
aResult.AppendElement(mo);
|
||||
aResult.AppendElement(mo.forget());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1998,8 +1998,7 @@ static void* CreateTokens(nsINode* aRootNode, const nsString* types)
|
||||
++iter;
|
||||
} while (iter != end && !nsContentUtils::IsHTMLWhitespace(*iter));
|
||||
|
||||
nsCOMPtr<nsIAtom> token = do_GetAtom(Substring(start, iter));
|
||||
tokens->AppendElement(token);
|
||||
tokens->AppendElement(do_GetAtom(Substring(start, iter)));
|
||||
|
||||
// skip whitespace
|
||||
while (iter != end && nsContentUtils::IsHTMLWhitespace(*iter)) {
|
||||
|
@ -464,7 +464,7 @@ AudioContext::DecodeAudioData(const ArrayBuffer& aBuffer,
|
||||
&aSuccessCallback, failureCallback));
|
||||
mDecoder.AsyncDecodeMedia(contentType.get(), data, length, *job);
|
||||
// Transfer the ownership to mDecodeJobs
|
||||
mDecodeJobs.AppendElement(job);
|
||||
mDecodeJobs.AppendElement(job.forget());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -802,7 +802,7 @@ SpeechRecognition::SplitSamplesBuffer(const int16_t* aSamplesBuffer,
|
||||
memcpy(chunk->Data(), aSamplesBuffer + chunkStart,
|
||||
mAudioSamplesPerChunk * sizeof(int16_t));
|
||||
|
||||
aResult.AppendElement(chunk);
|
||||
aResult.AppendElement(chunk.forget());
|
||||
chunkStart += mAudioSamplesPerChunk;
|
||||
}
|
||||
|
||||
@ -851,8 +851,7 @@ SpeechRecognition::FeedAudioData(already_AddRefed<SharedBuffer> aSamples,
|
||||
samplesIndex += FillSamplesBuffer(samples, aDuration);
|
||||
|
||||
if (mBufferedSamples == mAudioSamplesPerChunk) {
|
||||
chunksToSend.AppendElement(mAudioSamplesBuffer);
|
||||
mAudioSamplesBuffer = nullptr;
|
||||
chunksToSend.AppendElement(mAudioSamplesBuffer.forget());
|
||||
mBufferedSamples = 0;
|
||||
}
|
||||
}
|
||||
|
@ -126,8 +126,7 @@ nsresult nsDocShellForwardsEnumerator::BuildArrayRecursive(nsIDocShellTreeItem*
|
||||
// add this item to the array
|
||||
if (mDocShellType == nsIDocShellTreeItem::typeAll ||
|
||||
inItem->ItemType() == mDocShellType) {
|
||||
nsWeakPtr weakItem = do_GetWeakReference(inItem);
|
||||
if (!inItemArray.AppendElement(weakItem))
|
||||
if (!inItemArray.AppendElement(do_GetWeakReference(inItem)))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -170,8 +169,7 @@ nsresult nsDocShellBackwardsEnumerator::BuildArrayRecursive(nsIDocShellTreeItem*
|
||||
// add this item to the array
|
||||
if (mDocShellType == nsIDocShellTreeItem::typeAll ||
|
||||
inItem->ItemType() == mDocShellType) {
|
||||
nsWeakPtr weakItem = do_GetWeakReference(inItem);
|
||||
if (!inItemArray.AppendElement(weakItem))
|
||||
if (!inItemArray.AppendElement(do_GetWeakReference(inItem)))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -1500,8 +1500,7 @@ IndexedDBObjectStoreRequestParent::ConvertBlobActors(
|
||||
|
||||
for (uint32_t index = 0; index < length; index++) {
|
||||
BlobParent* actor = static_cast<BlobParent*>(aActors[index]);
|
||||
nsCOMPtr<nsIDOMBlob> blob = actor->GetBlob();
|
||||
aBlobs.AppendElement(blob);
|
||||
aBlobs.AppendElement(actor->GetBlob());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,8 +62,7 @@ XBLChildrenElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsCharSeparatedTokenizer tok(aValue, '|',
|
||||
nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL);
|
||||
while (tok.hasMoreTokens()) {
|
||||
nsCOMPtr<nsIAtom> atom = do_GetAtom(tok.nextToken());
|
||||
mIncludes.AppendElement(atom);
|
||||
mIncludes.AppendElement(do_GetAtom(tok.nextToken()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2762,8 +2762,7 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
|
||||
* incremented during empty transactions.
|
||||
*/
|
||||
void AddPaintedPresShell(nsIPresShell* shell) {
|
||||
nsWeakPtr weakShell = do_GetWeakReference(shell);
|
||||
PaintedPresShellList()->AppendElement(weakShell);
|
||||
PaintedPresShellList()->AppendElement(do_GetWeakReference(shell));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -133,8 +133,7 @@ void
|
||||
RtspControllerChild::AddMetaData(
|
||||
already_AddRefed<nsIStreamingProtocolMetaData>&& meta)
|
||||
{
|
||||
nsCOMPtr<nsIStreamingProtocolMetaData> data = meta;
|
||||
mMetaArray.AppendElement(data);
|
||||
mMetaArray.AppendElement(mozilla::Move(meta));
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user