Bug 1286170 - Handle move-assignment of SourceBufferIterators correctly. r=edwin

This commit is contained in:
Seth Fowler 2016-07-12 00:45:01 -07:00
parent a92a8b9e06
commit da8a36ae22
2 changed files with 17 additions and 9 deletions

View File

@ -30,6 +30,22 @@ SourceBufferIterator::~SourceBufferIterator()
}
}
SourceBufferIterator&
SourceBufferIterator::operator=(SourceBufferIterator&& aOther)
{
if (mOwner) {
mOwner->OnIteratorRelease();
}
mOwner = Move(aOther.mOwner);
mState = aOther.mState;
mData = aOther.mData;
mChunkCount = aOther.mChunkCount;
mByteCount = aOther.mByteCount;
return *this;
}
SourceBufferIterator::State
SourceBufferIterator::AdvanceOrScheduleResume(IResumable* aConsumer)
{

View File

@ -100,15 +100,7 @@ public:
~SourceBufferIterator();
SourceBufferIterator& operator=(SourceBufferIterator&& aOther)
{
mOwner = Move(aOther.mOwner);
mState = aOther.mState;
mData = aOther.mData;
mChunkCount = aOther.mChunkCount;
mByteCount = aOther.mByteCount;
return *this;
}
SourceBufferIterator& operator=(SourceBufferIterator&& aOther);
/**
* Returns true if there are no more than @aBytes remaining in the