Bug 1057688 - Skip doing a DNSPrefetch when LOAD_NO_NETWORK_IO or ONLY_FROM_CACHE flags are present r=mcmanus

This commit is contained in:
Valentin Gosu 2014-10-20 13:45:30 +03:00
Родитель f91fdd7365
Коммит 74a360e504
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -4857,10 +4857,13 @@ nsHttpChannel::BeginConnect()
if (mLoadFlags & VALIDATE_ALWAYS || BYPASS_LOCAL_CACHE(mLoadFlags))
mCaps |= NS_HTTP_REFRESH_DNS;
if (!mConnectionInfo->UsingHttpProxy()) {
if (!mConnectionInfo->UsingHttpProxy() &&
!(mLoadFlags & (LOAD_NO_NETWORK_IO | LOAD_ONLY_FROM_CACHE))) {
// Start a DNS lookup very early in case the real open is queued the DNS can
// happen in parallel. Do not do so in the presence of an HTTP proxy as
// all lookups other than for the proxy itself are done by the proxy.
// Also we don't do a lookup if the LOAD_NO_NETWORK_IO or
// LOAD_ONLY_FROM_CACHE flags are set.
//
// We keep the DNS prefetch object around so that we can retrieve
// timing information from it. There is no guarantee that we actually