зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1122788 - patch 1 - nsMultiplexInputStream should not use Tell() in debug builds, r=bz
This commit is contained in:
Родитель
50083808c2
Коммит
c018e81125
|
@ -141,25 +141,10 @@ nsMultiplexInputStream::GetCount(uint32_t* aCount)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static bool
|
||||
SeekableStreamAtBeginning(nsIInputStream* aStream)
|
||||
{
|
||||
int64_t streamPos;
|
||||
nsCOMPtr<nsISeekableStream> stream = do_QueryInterface(aStream);
|
||||
if (stream && NS_SUCCEEDED(stream->Tell(&streamPos)) && streamPos != 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMultiplexInputStream::AppendStream(nsIInputStream* aStream)
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
NS_ASSERTION(SeekableStreamAtBeginning(aStream),
|
||||
"Appended stream not at beginning.");
|
||||
return mStreams.AppendElement(aStream) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -167,8 +152,6 @@ NS_IMETHODIMP
|
|||
nsMultiplexInputStream::InsertStream(nsIInputStream* aStream, uint32_t aIndex)
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
NS_ASSERTION(SeekableStreamAtBeginning(aStream),
|
||||
"Inserted stream not at beginning.");
|
||||
mStreams.InsertElementAt(aIndex, aStream);
|
||||
if (mCurrentStream > aIndex ||
|
||||
(mCurrentStream == aIndex && mStartedReadingCurrent)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче