Bug 1382845 - We should cancel mNetworkTriggerTimer when we start reading data from the cache. r=michal

MozReview-Commit-ID: HOnWemy2YCY
This commit is contained in:
Valentin Gosu 2017-07-21 01:25:02 +03:00
Родитель d53eee5b25
Коммит 5c26b3aa77
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -5015,6 +5015,13 @@ nsHttpChannel::ReadFromCache(bool alreadyMarkedValid)
LOG(("nsHttpChannel::ReadFromCache [this=%p] " LOG(("nsHttpChannel::ReadFromCache [this=%p] "
"Using cached copy of: %s\n", this, mSpec.get())); "Using cached copy of: %s\n", this, mSpec.get()));
// When racing the cache with the network with a timer, and we get data from
// the cache, we should prevent the timer from triggering a network request.
if (mNetworkTriggerTimer) {
mNetworkTriggerTimer->Cancel();
mNetworkTriggerTimer = nullptr;
}
if (mRaceCacheWithNetwork) { if (mRaceCacheWithNetwork) {
MOZ_ASSERT(mFirstResponseSource != RESPONSE_FROM_CACHE); MOZ_ASSERT(mFirstResponseSource != RESPONSE_FROM_CACHE);
if (mFirstResponseSource == RESPONSE_PENDING) { if (mFirstResponseSource == RESPONSE_PENDING) {