Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2022-04-28 10:45:19 +08:00
commit 6de07653b9
368 changed files with 144 additions and 46366 deletions

View file

@ -18,8 +18,6 @@
#include "Http2Push.h"
#include "Http2Session.h"
#include "mozilla/Telemetry.h"
namespace mozilla {
namespace net {

View file

@ -105,7 +105,7 @@ public:
// determine if a version of the protocol is enabled for index < kCount
bool ProtocolEnabled(uint32_t index) const;
uint8_t Version[kCount]; // telemetry enum e.g. SPDY_VERSION_31
uint8_t Version[kCount]; // enum e.g. SPDY_VERSION_31
nsCString VersionString[kCount]; // npn string e.g. "spdy/3.1"
// the ALPNCallback function allows the protocol stack to decide whether or

View file

@ -1061,13 +1061,6 @@ AltSvcOverride::GetParallelSpeculativeConnectLimit(
return NS_OK;
}
NS_IMETHODIMP
AltSvcOverride::GetIsFromPredictor(bool *isFromPredictor)
{
*isFromPredictor = false;
return NS_OK;
}
NS_IMETHODIMP
AltSvcOverride::GetAllow1918(bool *allow)
{

View file

@ -13,7 +13,6 @@
#include "nsDeque.h"
#include "nsString.h"
#include "nsIMemoryReporter.h"
#include "mozilla/Telemetry.h"
namespace mozilla {
namespace net {
@ -85,10 +84,6 @@ protected:
uint32_t mPeakSize;
uint32_t mPeakCount;
MOZ_INIT_OUTSIDE_CTOR
Telemetry::ID mPeakSizeID;
MOZ_INIT_OUTSIDE_CTOR
Telemetry::ID mPeakCountID;
private:
RefPtr<HpackDynamicTableReporter> mDynamicReporter;
@ -101,8 +96,6 @@ class Http2Decompressor final : public Http2BaseCompressor
public:
Http2Decompressor()
{
mPeakSizeID = Telemetry::HPACK_PEAK_SIZE_DECOMPRESSOR;
mPeakCountID = Telemetry::HPACK_PEAK_COUNT_DECOMPRESSOR;
};
virtual ~Http2Decompressor() { } ;
@ -159,8 +152,6 @@ public:
mBufferSizeChangeWaiting(false),
mLowestBufferSizeWaiting(0)
{
mPeakSizeID = Telemetry::HPACK_PEAK_SIZE_COMPRESSOR;
mPeakCountID = Telemetry::HPACK_PEAK_COUNT_COMPRESSOR;
};
virtual ~Http2Compressor() { }

View file

@ -19,7 +19,6 @@
#include "Http2Push.h"
#include "mozilla/EndianUtils.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Preferences.h"
#include "nsHttp.h"
#include "nsHttpHandler.h"
@ -97,7 +96,6 @@ Http2Session::Http2Session(nsISocketTransport *aSocketTransport, uint32_t versio
, mGoAwayID(0)
, mOutgoingGoAwayID(0)
, mConcurrent(0)
, mServerPushedResources(0)
, mServerInitialStreamWindow(kDefaultRwin)
, mLocalSessionWindow(kDefaultRwin)
, mServerSessionWindow(kDefaultRwin)
@ -1628,7 +1626,6 @@ Http2Session::RecvPushPromise(Http2Session *self)
return rv;
Http2Stream *associatedStream = self->mInputFrameDataStream;
++(self->mServerPushedResources);
// Anytime we start using the high bit of stream ID (either client or server)
// begin to migrate to a new session.

View file

@ -441,9 +441,6 @@ private:
// below the current value
uint32_t mConcurrent;
// The number of server initiated promises, tracked for telemetry
uint32_t mServerPushedResources;
// The server rwin for new streams as determined from a SETTINGS frame
uint32_t mServerInitialStreamWindow;

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set expandtab ts=4 sw=4 sts=4 cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -5829,8 +5828,6 @@ nsHttpChannel::HandleBeginConnectContinue()
nsresult
nsHttpChannel::BeginConnectContinue()
{
nsresult rv;
// Check if request was cancelled during suspend AFTER on-modify-request or
// on-useragent.
if (mCanceled) {
@ -6585,7 +6582,7 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st
mTransferSize = mTransaction->GetTransferSize();
// If we are using the transaction to serve content, we also save the
// time since async open in the cache entry so we can compare telemetry
// time since async open in the cache entry so we can compare time
// between cache and net response.
if (request == mTransactionPump && mCacheEntry &&
!mAsyncOpenTime.IsNull() && !mOnStartRequestTimestamp.IsNull()) {
@ -6652,41 +6649,6 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st
}
}
// HTTP_CHANNEL_DISPOSITION TELEMETRY
enum ChannelDisposition
{
kHttpCanceled = 0,
kHttpDisk = 1,
kHttpNetOK = 2,
kHttpNetEarlyFail = 3,
kHttpNetLateFail = 4,
kHttpsCanceled = 8,
kHttpsDisk = 9,
kHttpsNetOK = 10,
kHttpsNetEarlyFail = 11,
kHttpsNetLateFail = 12
} chanDisposition = kHttpCanceled;
// HTTP 0.9 is more likely to be an error than really 0.9, so count it that way
if (mCanceled) {
chanDisposition = kHttpCanceled;
} else if (!mUsedNetwork) {
chanDisposition = kHttpDisk;
} else if (NS_SUCCEEDED(status) &&
mResponseHead &&
mResponseHead->Version() != NS_HTTP_VERSION_0_9) {
chanDisposition = kHttpNetOK;
} else if (!mTransferSize) {
chanDisposition = kHttpNetEarlyFail;
} else {
chanDisposition = kHttpNetLateFail;
}
if (IsHTTPS()) {
// shift http to https disposition enums
chanDisposition = static_cast<ChannelDisposition>(chanDisposition + kHttpsCanceled);
}
LOG((" nsHttpChannel::OnStopRequest ChannelDisposition %d\n", chanDisposition));
// if needed, check cache entry has all data we expect
if (mCacheEntry && mCachePump &&
mConcurrentCacheAccess && contentComplete) {

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set et cin ts=4 sw=4 sts=4: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set expandtab ts=4 sw=4 sts=4 cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -28,7 +27,6 @@
#include "nsServiceManagerUtils.h"
#include "nsILoadContext.h"
#include "nsIURL.h"
#include "mozilla/Telemetry.h"
#include "nsIProxiedChannel.h"
#include "nsIProxyInfo.h"

View file

@ -378,7 +378,7 @@ private:
// for the end of
// the handsake.
int64_t mContentBytesWritten0RTT;
bool mEarlyDataNegotiated; //Only used for telemetry
bool mEarlyDataNegotiated;
nsCString mEarlyNegotiatedALPN;
bool mDid0RTTSpdy;

View file

@ -1,4 +1,3 @@
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -393,7 +392,6 @@ public: // intentional!
bool mOverridesOK;
uint32_t mParallelSpeculativeConnectLimit;
bool mIgnoreIdle;
bool mIsFromPredictor;
bool mAllow1918;
private:
@ -447,7 +445,6 @@ nsHttpConnectionMgr::SpeculativeConnect(nsHttpConnectionInfo *ci,
args->mParallelSpeculativeConnectLimit =
overrider->GetParallelSpeculativeConnectLimit();
args->mIgnoreIdle = overrider->GetIgnoreIdle();
args->mIsFromPredictor = overrider->GetIsFromPredictor();
args->mAllow1918 = overrider->GetAllow1918();
}
@ -1285,7 +1282,7 @@ nsHttpConnectionMgr::MakeNewConnection(nsConnectionEntry *ent,
if (AtActiveConnectionLimit(ent, trans->Caps()))
return NS_ERROR_NOT_AVAILABLE;
nsresult rv = CreateTransport(ent, trans, trans->Caps(), false, false, true);
nsresult rv = CreateTransport(ent, trans, trans->Caps(), false, true);
if (NS_FAILED(rv)) {
/* hard failure */
LOG(("nsHttpConnectionMgr::MakeNewConnection [ci = %s trans = %p] "
@ -1946,7 +1943,6 @@ nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
nsAHttpTransaction *trans,
uint32_t caps,
bool speculative,
bool isFromPredictor,
bool allow1918)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -1955,10 +1951,6 @@ nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
if (speculative) {
sock->SetSpeculative(true);
sock->SetAllow1918(allow1918);
if (isFromPredictor) {
sock->SetIsFromPredictor(true);
}
}
// The socket stream holds the reference to the half open
@ -2884,13 +2876,11 @@ nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, ARefBase *param)
uint32_t parallelSpeculativeConnectLimit =
gHttpHandler->ParallelSpeculativeConnectLimit();
bool ignoreIdle = false;
bool isFromPredictor = false;
bool allow1918 = false;
if (args->mOverridesOK) {
parallelSpeculativeConnectLimit = args->mParallelSpeculativeConnectLimit;
ignoreIdle = args->mIgnoreIdle;
isFromPredictor = args->mIsFromPredictor;
allow1918 = args->mAllow1918;
}
@ -2900,7 +2890,7 @@ nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, ARefBase *param)
!ent->mIdleConns.Length()) &&
!(keepAlive && RestrictConnections(ent)) &&
!AtActiveConnectionLimit(ent, args->mTrans->Caps())) {
CreateTransport(ent, args->mTrans, args->mTrans->Caps(), true, isFromPredictor, allow1918);
CreateTransport(ent, args->mTrans, args->mTrans->Caps(), true, allow1918);
} else {
LOG(("OnMsgSpeculativeConnect Transport "
"not created due to existing connection count\n"));
@ -2949,7 +2939,6 @@ nsHalfOpenSocket::nsHalfOpenSocket(nsConnectionEntry *ent,
, mDispatchedMTransaction(false)
, mCaps(caps)
, mSpeculative(false)
, mIsFromPredictor(false)
, mAllow1918(true)
, mHasConnected(false)
, mPrimaryConnectedOK(false)

View file

@ -1,4 +1,3 @@
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -435,9 +434,6 @@ private:
bool IsSpeculative() { return mSpeculative; }
void SetSpeculative(bool val) { mSpeculative = val; }
bool IsFromPredictor() { return mIsFromPredictor; }
void SetIsFromPredictor(bool val) { mIsFromPredictor = val; }
bool Allow1918() { return mAllow1918; }
void SetAllow1918(bool val) { mAllow1918 = val; }
@ -462,11 +458,6 @@ private:
// more connections that are needed.)
bool mSpeculative;
// mIsFromPredictor is set if the socket originated from the network
// Predictor. It is used to gather telemetry data on used speculative
// connections from the predictor.
bool mIsFromPredictor;
bool mAllow1918;
TimeStamp mPrimarySynStarted;
@ -532,7 +523,7 @@ private:
nsresult EnsureSocketThreadTarget();
void ClosePersistentConnections(nsConnectionEntry *ent);
nsresult CreateTransport(nsConnectionEntry *, nsAHttpTransaction *,
uint32_t, bool, bool, bool);
uint32_t, bool, bool);
void AddActiveConn(nsHttpConnection *, nsConnectionEntry *);
void DecrementActiveConnCount(nsHttpConnection *);
void StartedConnect();

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -1505,8 +1504,7 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
}
}
// toggle to true anytime a token bucket related pref is changed.. that
// includes telemetry and allow-experiments because of the abtest profile
// toggle to true anytime a token bucket related pref is changed.
bool requestTokenBucketUpdated = false;
// "security.ssl3.ecdhe_rsa_aes_128_gcm_sha256" is the required h2 interop