No need to optimize one lock here since telemetry tells us only 1 out of 1m request with alt-svc
https://searchfox.org/mozilla-central/rev/b243debf6235b050b42fd2eb615fdc729636ca6b/netwerk/protocol/http/nsHttpChannel.cpp#6670

Differential Revision: https://phabricator.services.mozilla.com/D57925

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Junior Hsu 2019-12-24 16:14:54 +00:00
Родитель f271f11c2c
Коммит a92a02a283
2 изменённых файлов: 10 добавлений и 1 удалений

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

@ -294,6 +294,8 @@ nsHttpHandler::nsHttpHandler()
mNextChannelId(1),
mLastActiveTabLoadOptimizationLock(
"nsHttpConnectionMgr::LastActiveTabLoadOptimization"),
mSpdyBlacklistLock(
"nsHttpHandler::SpdyBlacklist"),
mThroughCaptivePortal(false) {
LOG(("Creating nsHttpHandler [this=%p].\n", this));
@ -2669,11 +2671,17 @@ bool nsHttpHandler::IsBeforeLastActiveTabLoadOptimization(
}
void nsHttpHandler::BlacklistSpdy(const nsHttpConnectionInfo* ci) {
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
mConnMgr->BlacklistSpdy(ci);
mBlacklistedSpdyOrigins.PutEntry(ci->GetOrigin());
if (!mBlacklistedSpdyOrigins.Contains(ci->GetOrigin())) {
MutexAutoLock lock(mSpdyBlacklistLock);
mBlacklistedSpdyOrigins.PutEntry(ci->GetOrigin());
}
}
bool nsHttpHandler::IsSpdyBlacklisted(const nsHttpConnectionInfo* ci) {
MutexAutoLock lock(mSpdyBlacklistLock);
return mBlacklistedSpdyOrigins.Contains(ci->GetOrigin());
}

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

@ -771,6 +771,7 @@ class nsHttpHandler final : public nsIHttpProtocolHandler,
Mutex mLastActiveTabLoadOptimizationLock;
TimeStamp mLastActiveTabLoadOptimizationHit;
Mutex mSpdyBlacklistLock;
public:
MOZ_MUST_USE nsresult NewChannelId(uint64_t& channelId);