Bug 1378714 - [RCWN] Make sure we ReadFromCache even when OnCacheEntryAvailable is called before AsyncOpenURI is called. r=michal

MozReview-Commit-ID: KHUmZp8RuT8
This commit is contained in:
Valentin Gosu 2017-07-11 14:18:58 +02:00
Родитель 038afacb9f
Коммит cde7f99f55
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -485,6 +485,14 @@ nsHttpChannel::Connect()
// otherwise, let's just proceed without using the cache.
}
// When racing, if OnCacheEntryAvailable is called before AsyncOpenURI
// returns, then we may not have started reading from the cache.
// If the content is valid, we should attempt to do so, as technically the
// cache has won the race.
if (sRCWNEnabled && mCachedContentIsValid && mNetworkTriggered) {
Unused << ReadFromCache(true);
}
return TriggerNetwork(0);
}