зеркало из https://github.com/mozilla/gecko-dev.git
part one of bug 113163 "Performance problem at downloading"
patch=ak@muc.de, r=gordon@netscape.com, sr=darin@netscape.com
This commit is contained in:
Родитель
3a9427fab8
Коммит
0686983ad3
|
@ -86,6 +86,7 @@ nsStorageTransport::nsStorageTransport()
|
||||||
, mSegmentSize(DEFAULT_SEGMENT_SIZE)
|
, mSegmentSize(DEFAULT_SEGMENT_SIZE)
|
||||||
, mMaxSize(DEFAULT_BUFFER_SIZE)
|
, mMaxSize(DEFAULT_BUFFER_SIZE)
|
||||||
, mSegments(nsnull)
|
, mSegments(nsnull)
|
||||||
|
, mSegmentsLast(nsnull)
|
||||||
, mWriteSegment(nsnull)
|
, mWriteSegment(nsnull)
|
||||||
, mWriteCursor(0)
|
, mWriteCursor(0)
|
||||||
{
|
{
|
||||||
|
@ -226,11 +227,9 @@ nsStorageTransport::AppendSegment(nsSegment *aSegment)
|
||||||
{
|
{
|
||||||
if (!mSegments)
|
if (!mSegments)
|
||||||
mSegments = aSegment;
|
mSegments = aSegment;
|
||||||
else {
|
else
|
||||||
nsSegment *s = mSegments;
|
mSegmentsLast->next = aSegment;
|
||||||
for (; s && s->next; s = s->next);
|
mSegmentsLast = aSegment;
|
||||||
s->next = aSegment;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -249,7 +248,7 @@ nsStorageTransport::TruncateTo(PRUint32 aOffset)
|
||||||
if (aOffset < mWriteCursor) {
|
if (aOffset < mWriteCursor) {
|
||||||
if (aOffset == 0) {
|
if (aOffset == 0) {
|
||||||
DeleteSegments(mSegments);
|
DeleteSegments(mSegments);
|
||||||
mSegments = nsnull;
|
mSegments = mSegmentsLast = nsnull;
|
||||||
mWriteSegment = nsnull;
|
mWriteSegment = nsnull;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -265,6 +264,7 @@ nsStorageTransport::TruncateTo(PRUint32 aOffset)
|
||||||
DeleteSegments(s->next);
|
DeleteSegments(s->next);
|
||||||
s->next = nsnull;
|
s->next = nsnull;
|
||||||
}
|
}
|
||||||
|
mSegmentsLast = s;
|
||||||
mWriteSegment = s;
|
mWriteSegment = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,6 +197,7 @@ private:
|
||||||
PRUint32 mMaxSize;
|
PRUint32 mMaxSize;
|
||||||
|
|
||||||
nsSegment *mSegments;
|
nsSegment *mSegments;
|
||||||
|
nsSegment *mSegmentsLast;
|
||||||
|
|
||||||
nsSegment *mWriteSegment;
|
nsSegment *mWriteSegment;
|
||||||
PRUint32 mWriteCursor;
|
PRUint32 mWriteCursor;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче