Bug 1315554 - Part 6. Reuse the same SourceBuffer when decoding a resource within an ICO. r=tnikkel

This commit is contained in:
Andrew Osmond
2017-07-22 07:50:31 -04:00
parent eddf61eb98
commit d72ae32db1
4 changed files with 51 additions and 48 deletions

View File

@@ -234,7 +234,7 @@ DecoderFactory::CreateMetadataDecoder(DecoderType aType,
/* static */ already_AddRefed<Decoder>
DecoderFactory::CreateDecoderForICOResource(DecoderType aType,
NotNull<SourceBuffer*> aSourceBuffer,
SourceBufferIterator&& aIterator,
NotNull<nsICODecoder*> aICODecoder,
const Maybe<IntSize>& aExpectedSize,
const Maybe<uint32_t>& aDataOffset
@@ -263,7 +263,7 @@ DecoderFactory::CreateDecoderForICOResource(DecoderType aType,
// Initialize the decoder, copying settings from @aICODecoder.
MOZ_ASSERT(!aICODecoder->IsMetadataDecode());
decoder->SetMetadataDecode(aICODecoder->IsMetadataDecode());
decoder->SetIterator(aSourceBuffer->Iterator());
decoder->SetIterator(Forward<SourceBufferIterator>(aIterator));
decoder->SetOutputSize(aICODecoder->OutputSize());
if (aExpectedSize) {
decoder->SetExpectedSize(*aExpectedSize);