Backed out changeset 1e9b8d8d2c8f (bug 1595833) for causing linux tsan build bustages. CLOSED TREE

--HG--
extra : amend_source : 5cd314ae4ddb281fd5f5c35477994883c9e3e45f
This commit is contained in:
Cosmin Sabou 2019-11-20 18:57:29 +02:00
parent 3ee0fc5c70
commit 3a4c7de3a6
4 changed files with 6 additions and 60 deletions

View File

@ -136,9 +136,6 @@ nsHttpConnectionMgr::nsHttpConnectionMgr()
mPruningNoTraffic(false),
mTimeoutTickArmed(false),
mTimeoutTickNext(1),
#ifdef DEBUG
mParamUpdateFlags(0),
#endif
mCurrentTopLevelOuterContentWindowId(0),
mThrottlingInhibitsReading(false),
mActiveTabTransactionsExist(false),
@ -2971,10 +2968,6 @@ void nsHttpConnectionMgr::OnMsgUpdateParam(int32_t inParam, ARefBase*) {
uint16_t name = ((param)&0xFFFF0000) >> 16;
uint16_t value = param & 0x0000FFFF;
LOG(("nsHttpConnectionMgr::OnMsgUpdateParam param=%" PRIu32 ", name=%" PRIu16
", value=%" PRIu16,
param, name, value));
switch (name) {
case MAX_CONNECTIONS:
mMaxConns = value;
@ -3018,11 +3011,6 @@ void nsHttpConnectionMgr::OnMsgUpdateParam(int32_t inParam, ARefBase*) {
default:
MOZ_ASSERT_UNREACHABLE("unexpected parameter name");
}
#ifdef DEBUG
// We only use this for a debug-only assertion. An atomic `or` is expensive.
mParamUpdateFlags |= (1 << name);
#endif
}
// nsHttpConnectionMgr::nsConnectionEntry
@ -4034,15 +4022,11 @@ nsHttpConnectionMgr::nsHalfOpenSocket::~nsHalfOpenSocket() {
bool nsHttpConnectionMgr::BeConservativeIfProxied(nsIProxyInfo* proxy) {
if (mBeConservativeForProxy) {
LOG(
("nsHttpConnectionMgr::BeConservativeIfProxied, "
"mBeConservativeForProxy == true"));
// The pref says to be conservative for proxies.
return true;
}
if (!proxy) {
LOG(("nsHttpConnectionMgr::BeConservativeIfProxied, There is no proxy"));
// There is no proxy, so be conservative by default.
return true;
}
@ -4051,10 +4035,6 @@ bool nsHttpConnectionMgr::BeConservativeIfProxied(nsIProxyInfo* proxy) {
// This logic was copied from nsSSLIOLayerAddToSocket.
nsAutoCString proxyHost;
proxy->GetHost(proxyHost);
LOG((
"nsHttpConnectionMgr::BeConservativeIfProxied, proxyHost.IsEmpty() == %d",
proxyHost.IsEmpty()));
return proxyHost.IsEmpty();
}

View File

@ -66,9 +66,7 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache {
THROTTLING_READ_INTERVAL,
THROTTLING_HOLD_TIME,
THROTTLING_MAX_TIME,
PROXY_BE_CONSERVATIVE,
PARAM_COUNT // keep this one last
PROXY_BE_CONSERVATIVE
};
//-------------------------------------------------------------------------
@ -262,13 +260,6 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache {
void BlacklistSpdy(const nsHttpConnectionInfo* ci);
#ifdef DEBUG
// Read the mParamUpdateFlags counter, callable on any thread. This is used
// to check we have sent all the parameters to connection manager during
// startup.
uint32_t GetParamUpdateCount() { return mParamUpdateFlags; }
#endif
private:
virtual ~nsHttpConnectionMgr();
@ -731,12 +722,6 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache {
bool mTimeoutTickArmed;
uint32_t mTimeoutTickNext;
#ifdef DEBUG
// Counts the number of calls to OnMsgUpdateParam so we can assert all
// parameters have been sent to connection manager.
Atomic<uint32_t, ReleaseAcquire> mParamUpdateFlags;
#endif
//
// the connection table
//

View File

@ -453,10 +453,6 @@ nsresult nsHttpHandler::Init() {
Preferences::GetBool(HTTP_PREF("active_tab_priority"), true);
}
// Make sure we have mConnMgr before we start reading the preferences the
// first time to be able to send them down to the socket thread.
EnsureConnectionMgr();
// monitor some preference changes
Preferences::RegisterPrefixCallbacks(nsHttpHandler::PrefsChanged,
gCallbackPrefs, this);
@ -566,12 +562,6 @@ nsresult nsHttpHandler::Init() {
if (pc) {
pc->GetParentalControlsEnabled(&mParentalControlEnabled);
}
// Here we check that all the expected parameters have been sent to the
// connection manager.
MOZ_ASSERT_IF(mConnMgr, mConnMgr->GetParamUpdateCount() ==
((1 << nsHttpConnectionMgr::PARAM_COUNT) - 1));
return NS_OK;
}
@ -590,26 +580,18 @@ void nsHttpHandler::MakeNewRequestTokenBucket() {
}
}
bool nsHttpHandler::EnsureConnectionMgr() {
nsresult nsHttpHandler::InitConnectionMgr() {
// Init ConnectionManager only on parent!
if (IsNeckoChild()) {
return false;
return NS_OK;
}
nsresult rv;
if (!mConnMgr) {
mConnMgr = new nsHttpConnectionMgr();
}
return true;
}
nsresult nsHttpHandler::InitConnectionMgr() {
nsresult rv;
// Init ConnectionManager only on parent!
if (!EnsureConnectionMgr()) {
return NS_OK;
}
rv = mConnMgr->Init(
mMaxUrgentExcessiveConns, mMaxConnections,
mMaxPersistentConnectionsPerServer, mMaxPersistentConnectionsPerProxy,

View File

@ -476,7 +476,6 @@ class nsHttpHandler final : public nsIHttpProtocolHandler,
MOZ_MUST_USE nsresult SetAcceptLanguages();
MOZ_MUST_USE nsresult SetAcceptEncodings(const char*, bool mIsSecure);
bool EnsureConnectionMgr();
MOZ_MUST_USE nsresult InitConnectionMgr();
void NotifyObservers(nsIChannel* chan, const char* event);