Bug 716140 - Handle discarding specially so it gets notified synchronously. r=seth

--HG--
extra : rebase_source : 1bd66dcec4925b486af0905dbd07286bb3ae729e
This commit is contained in:
Joe Drew 2013-02-07 17:22:38 -05:00
parent c5a2a76f54
commit fcda375530
3 changed files with 14 additions and 1 deletions

View File

@ -2504,7 +2504,7 @@ RasterImage::Discard(bool force)
// Notify that we discarded
if (mStatusTracker)
mStatusTracker->GetDecoderObserver()->OnDiscard();
mStatusTracker->OnDiscard();
if (force)
DiscardTracker::Remove(&mDiscardTrackerNode);

View File

@ -849,6 +849,18 @@ imgStatusTracker::OnStopRequest(bool aLastPart,
}
}
void
imgStatusTracker::OnDiscard()
{
RecordDiscard();
/* notify the kids */
nsTObserverArray<imgRequestProxy*>::ForwardIterator iter(mConsumers);
while (iter.HasMore()) {
SendDiscard(iter.GetNext());
}
}
void
imgStatusTracker::OnDataAvailable()
{

View File

@ -160,6 +160,7 @@ public:
void OnStartRequest();
void OnDataAvailable();
void OnStopRequest(bool aLastPart, nsresult aStatus);
void OnDiscard();
/* non-virtual imgIOnloadBlocker methods */
// NB: If UnblockOnload is sent, and then we are asked to replay the