bug 792438 part 3: a kill switch r=honzab

This commit is contained in:
Patrick McManus 2012-12-04 18:06:29 -05:00
Родитель 72f1db69a9
Коммит 8c4e787a6a
4 изменённых файлов: 24 добавлений и 4 удалений

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

@ -914,6 +914,10 @@ pref("network.http.connection-timeout", 90);
// when starting a new speculative connection.
pref("network.http.speculative-parallel-limit", 6);
// Whether or not to block requests for non head js/css items (e.g. media)
// while those elements load.
pref("network.http.rendering-critical-requests-prioritization", true);
// Disable IPv6 for backup connections to workaround problems about broken
// IPv6 connectivity.
pref("network.http.fast-fallback-to-IPv4", true);

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

@ -4445,10 +4445,12 @@ nsHttpChannel::BeginConnect()
(BYPASS_LOCAL_CACHE(mLoadFlags)))
mCaps |= NS_HTTP_REFRESH_DNS;
if (mLoadAsBlocking)
mCaps |= NS_HTTP_LOAD_AS_BLOCKING;
if (mLoadUnblocked)
mCaps |= NS_HTTP_LOAD_UNBLOCKED;
if (gHttpHandler->CritialRequestPrioritization()) {
if (mLoadAsBlocking)
mCaps |= NS_HTTP_LOAD_AS_BLOCKING;
if (mLoadUnblocked)
mCaps |= NS_HTTP_LOAD_UNBLOCKED;
}
// Force-Reload should reset the persistent connection pool for this host
if (mLoadFlags & LOAD_FRESH_CONNECTION) {

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

@ -179,6 +179,7 @@ nsHttpHandler::nsHttpHandler()
, mSpdyPingTimeout(PR_SecondsToInterval(8))
, mConnectTimeout(90000)
, mParallelSpeculativeConnectLimit(6)
, mCritialRequestPrioritization(true)
{
#if defined(PR_LOGGING)
gHttpLog = PR_NewLogModule("nsHttp");
@ -1147,6 +1148,14 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
mParallelSpeculativeConnectLimit = (uint32_t) clamped(val, 0, 1024);
}
// Whether or not to block requests for non head js/css items (e.g. media)
// while those elements load.
if (PREF_CHANGED(HTTP_PREF("rendering-critical-requests-prioritization"))) {
rv = prefs->GetBoolPref(HTTP_PREF("rendering-critical-requests-prioritization"), &cVar);
if (NS_SUCCEEDED(rv))
mCritialRequestPrioritization = cVar;
}
// on transition of network.http.diagnostics to true print
// a bunch of information to the console
if (pref && PREF_CHANGED(HTTP_PREF("diagnostics"))) {

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

@ -98,6 +98,7 @@ public:
PRIntervalTime SpdyPingTimeout() { return mSpdyPingTimeout; }
uint32_t ConnectTimeout() { return mConnectTimeout; }
uint32_t ParallelSpeculativeConnectLimit() { return mParallelSpeculativeConnectLimit; }
bool CritialRequestPrioritization() { return mCritialRequestPrioritization; }
bool PromptTempRedirect() { return mPromptTempRedirect; }
@ -400,6 +401,10 @@ private:
// The maximum number of current global half open sockets allowable
// when starting a new speculative connection.
uint32_t mParallelSpeculativeConnectLimit;
// Whether or not to block requests for non head js/css items (e.g. media)
// while those elements load.
bool mCritialRequestPrioritization;
};
//-----------------------------------------------------------------------------