mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
381812 make it possible to get storage input streams for empty streams r=bsmedberg
This commit is contained in:
parent
10ea784eab
commit
07c4078d63
@ -384,7 +384,6 @@ NS_IMETHODIMP
|
||||
nsStorageStream::NewInputStream(PRInt32 aStartingOffset, nsIInputStream* *aInputStream)
|
||||
{
|
||||
NS_ENSURE_TRUE(mSegmentedBuffer, NS_ERROR_NOT_INITIALIZED);
|
||||
NS_ENSURE_TRUE(mSegmentedBuffer->GetSegmentCount(), NS_ERROR_NOT_INITIALIZED);
|
||||
|
||||
nsStorageInputStream *inputStream = new nsStorageInputStream(this, mSegmentSize);
|
||||
if (!inputStream)
|
||||
@ -534,6 +533,9 @@ nsStorageInputStream::Seek(PRUint32 aPosition)
|
||||
if (aPosition > length)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
if (length == 0)
|
||||
return NS_OK;
|
||||
|
||||
mSegmentNum = SegNum(aPosition);
|
||||
PRUint32 segmentOffset = SegOffset(aPosition);
|
||||
mReadCursor = mStorageStream->mSegmentedBuffer->GetSegment(mSegmentNum) +
|
||||
|
Loading…
Reference in New Issue
Block a user