Bug 1883954: Update, improve and unify HTTPS Telemetry, r=freddyb,kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D212661
This commit is contained in:
@@ -91,6 +91,7 @@ nsDocShellLoadState::nsDocShellLoadState(
|
|||||||
mTriggeringStorageAccess = aLoadState.TriggeringStorageAccess();
|
mTriggeringStorageAccess = aLoadState.TriggeringStorageAccess();
|
||||||
mTriggeringRemoteType = aLoadState.TriggeringRemoteType();
|
mTriggeringRemoteType = aLoadState.TriggeringRemoteType();
|
||||||
mWasSchemelessInput = aLoadState.WasSchemelessInput();
|
mWasSchemelessInput = aLoadState.WasSchemelessInput();
|
||||||
|
mHttpsUpgradeTelemetry = aLoadState.HttpsUpgradeTelemetry();
|
||||||
mCsp = aLoadState.Csp();
|
mCsp = aLoadState.Csp();
|
||||||
mOriginalURIString = aLoadState.OriginalURIString();
|
mOriginalURIString = aLoadState.OriginalURIString();
|
||||||
mCancelContentJSEpoch = aLoadState.CancelContentJSEpoch();
|
mCancelContentJSEpoch = aLoadState.CancelContentJSEpoch();
|
||||||
@@ -196,7 +197,8 @@ nsDocShellLoadState::nsDocShellLoadState(const nsDocShellLoadState& aOther)
|
|||||||
mUnstrippedURI(aOther.mUnstrippedURI),
|
mUnstrippedURI(aOther.mUnstrippedURI),
|
||||||
mRemoteTypeOverride(aOther.mRemoteTypeOverride),
|
mRemoteTypeOverride(aOther.mRemoteTypeOverride),
|
||||||
mTriggeringRemoteType(aOther.mTriggeringRemoteType),
|
mTriggeringRemoteType(aOther.mTriggeringRemoteType),
|
||||||
mWasSchemelessInput(aOther.mWasSchemelessInput) {
|
mWasSchemelessInput(aOther.mWasSchemelessInput),
|
||||||
|
mHttpsUpgradeTelemetry(aOther.mHttpsUpgradeTelemetry) {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(
|
MOZ_DIAGNOSTIC_ASSERT(
|
||||||
XRE_IsParentProcess(),
|
XRE_IsParentProcess(),
|
||||||
"Cloning a nsDocShellLoadState with the same load identifier is only "
|
"Cloning a nsDocShellLoadState with the same load identifier is only "
|
||||||
@@ -242,6 +244,11 @@ nsDocShellLoadState::nsDocShellLoadState(nsIURI* aURI, uint64_t aLoadIdentifier)
|
|||||||
: NOT_REMOTE_TYPE),
|
: NOT_REMOTE_TYPE),
|
||||||
mWasSchemelessInput(false) {
|
mWasSchemelessInput(false) {
|
||||||
MOZ_ASSERT(aURI, "Cannot create a LoadState with a null URI!");
|
MOZ_ASSERT(aURI, "Cannot create a LoadState with a null URI!");
|
||||||
|
if (aURI->SchemeIs("https")) {
|
||||||
|
mHttpsUpgradeTelemetry = nsILoadInfo::ALREADY_HTTPS;
|
||||||
|
} else {
|
||||||
|
mHttpsUpgradeTelemetry = nsILoadInfo::NO_UPGRADE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsDocShellLoadState::~nsDocShellLoadState() {
|
nsDocShellLoadState::~nsDocShellLoadState() {
|
||||||
@@ -1308,6 +1315,7 @@ DocShellLoadStateInit nsDocShellLoadState::Serialize(
|
|||||||
loadState.TriggeringStorageAccess() = mTriggeringStorageAccess;
|
loadState.TriggeringStorageAccess() = mTriggeringStorageAccess;
|
||||||
loadState.TriggeringRemoteType() = mTriggeringRemoteType;
|
loadState.TriggeringRemoteType() = mTriggeringRemoteType;
|
||||||
loadState.WasSchemelessInput() = mWasSchemelessInput;
|
loadState.WasSchemelessInput() = mWasSchemelessInput;
|
||||||
|
loadState.HttpsUpgradeTelemetry() = mHttpsUpgradeTelemetry;
|
||||||
loadState.Csp() = mCsp;
|
loadState.Csp() = mCsp;
|
||||||
loadState.OriginalURIString() = mOriginalURIString;
|
loadState.OriginalURIString() = mOriginalURIString;
|
||||||
loadState.CancelContentJSEpoch() = mCancelContentJSEpoch;
|
loadState.CancelContentJSEpoch() = mCancelContentJSEpoch;
|
||||||
|
|||||||
@@ -337,6 +337,15 @@ class nsDocShellLoadState final {
|
|||||||
|
|
||||||
bool GetWasSchemelessInput() { return mWasSchemelessInput; }
|
bool GetWasSchemelessInput() { return mWasSchemelessInput; }
|
||||||
|
|
||||||
|
void SetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType aHttpsUpgradeTelemetry) {
|
||||||
|
mHttpsUpgradeTelemetry = aHttpsUpgradeTelemetry;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType GetHttpsUpgradeTelemetry() {
|
||||||
|
return mHttpsUpgradeTelemetry;
|
||||||
|
}
|
||||||
|
|
||||||
// Determine the remote type of the process which should be considered
|
// Determine the remote type of the process which should be considered
|
||||||
// responsible for this load for the purposes of security checks.
|
// responsible for this load for the purposes of security checks.
|
||||||
//
|
//
|
||||||
@@ -612,6 +621,10 @@ class nsDocShellLoadState final {
|
|||||||
|
|
||||||
// if the to-be-loaded address had it protocol added through a fixup
|
// if the to-be-loaded address had it protocol added through a fixup
|
||||||
bool mWasSchemelessInput = false;
|
bool mWasSchemelessInput = false;
|
||||||
|
|
||||||
|
// Solely for the use of collecting Telemetry for HTTPS upgrades.
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType mHttpsUpgradeTelemetry =
|
||||||
|
nsILoadInfo::NO_UPGRADE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsDocShellLoadState_h__ */
|
#endif /* nsDocShellLoadState_h__ */
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
include "mozilla/dom/DomSecurityIPCUtils.h";
|
||||||
include "mozilla/GfxMessageUtils.h";
|
include "mozilla/GfxMessageUtils.h";
|
||||||
include "mozilla/dom/CSPMessageUtils.h";
|
include "mozilla/dom/CSPMessageUtils.h";
|
||||||
include "mozilla/dom/DocShellMessageUtils.h";
|
include "mozilla/dom/DocShellMessageUtils.h";
|
||||||
@@ -43,6 +44,7 @@ using mozilla::ImageIntSize from "Units.h";
|
|||||||
using nsSizeMode from "nsIWidgetListener.h";
|
using nsSizeMode from "nsIWidgetListener.h";
|
||||||
using mozilla::ScrollbarPreference from "mozilla/ScrollbarPreferences.h";
|
using mozilla::ScrollbarPreference from "mozilla/ScrollbarPreferences.h";
|
||||||
using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
|
using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
|
||||||
|
using nsILoadInfo::HTTPSUpgradeTelemetryType from "nsILoadInfo.h";
|
||||||
[RefCounted] using class nsIPrincipal from "nsIPrincipal.h";
|
[RefCounted] using class nsIPrincipal from "nsIPrincipal.h";
|
||||||
using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
|
using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
|
||||||
[RefCounted] using class nsIURI from "nsIURI.h";
|
[RefCounted] using class nsIURI from "nsIURI.h";
|
||||||
@@ -220,6 +222,7 @@ struct DocShellLoadStateInit
|
|||||||
bool AllowFocusMove;
|
bool AllowFocusMove;
|
||||||
bool IsFromProcessingFrameAttributes;
|
bool IsFromProcessingFrameAttributes;
|
||||||
bool WasSchemelessInput;
|
bool WasSchemelessInput;
|
||||||
|
HTTPSUpgradeTelemetryType HttpsUpgradeTelemetry;
|
||||||
|
|
||||||
// Fields missing due to lack of need or serialization
|
// Fields missing due to lack of need or serialization
|
||||||
// nsCOMPtr<nsIDocShell> mSourceDocShell;
|
// nsCOMPtr<nsIDocShell> mSourceDocShell;
|
||||||
|
|||||||
@@ -1434,6 +1434,8 @@ mozilla::ipc::IPCResult WindowGlobalParent::RecvReloadWithHttpsOnlyException() {
|
|||||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(insecureURI);
|
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState(insecureURI);
|
||||||
loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
|
loadState->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal());
|
||||||
loadState->SetLoadType(LOAD_NORMAL_REPLACE);
|
loadState->SetLoadType(LOAD_NORMAL_REPLACE);
|
||||||
|
loadState->SetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPS_ONLY_UPGRADE_DOWNGRADE);
|
||||||
|
|
||||||
RefPtr<CanonicalBrowsingContext> topBC = BrowsingContext()->Top();
|
RefPtr<CanonicalBrowsingContext> topBC = BrowsingContext()->Top();
|
||||||
topBC->LoadURI(loadState, /* setNavigating */ true);
|
topBC->LoadURI(loadState, /* setNavigating */ true);
|
||||||
|
|||||||
25
dom/security/DomSecurityIPCUtils.h
Normal file
25
dom/security/DomSecurityIPCUtils.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
#ifndef mozilla_dom_domsecurityipcutils_h
|
||||||
|
#define mozilla_dom_domsecurityipcutils_h
|
||||||
|
|
||||||
|
#include "ipc/EnumSerializer.h"
|
||||||
|
#include "nsILoadInfo.h"
|
||||||
|
|
||||||
|
namespace IPC {
|
||||||
|
|
||||||
|
// nsILoadInfo::HTTPSUpgradeTelemetryType over IPC.
|
||||||
|
template <>
|
||||||
|
struct ParamTraits<nsILoadInfo::HTTPSUpgradeTelemetryType>
|
||||||
|
: public ContiguousEnumSerializerInclusive<
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType,
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType::NO_UPGRADE,
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType::HTTPS_RR> {};
|
||||||
|
|
||||||
|
} // namespace IPC
|
||||||
|
|
||||||
|
#endif // mozilla_dom_domsecurityipcutils_h
|
||||||
@@ -14,6 +14,7 @@ DIRS += ["featurepolicy", "sanitizer", "trusted-types"]
|
|||||||
EXPORTS.mozilla.dom += [
|
EXPORTS.mozilla.dom += [
|
||||||
"CSPEvalChecker.h",
|
"CSPEvalChecker.h",
|
||||||
"CSPViolationData.h",
|
"CSPViolationData.h",
|
||||||
|
"DomSecurityIPCUtils.h",
|
||||||
"DOMSecurityMonitor.h",
|
"DOMSecurityMonitor.h",
|
||||||
"FramingChecker.h",
|
"FramingChecker.h",
|
||||||
"nsContentSecurityManager.h",
|
"nsContentSecurityManager.h",
|
||||||
|
|||||||
@@ -588,6 +588,19 @@ void nsHTTPSOnlyUtils::UpdateLoadStateAfterHTTPSFirstDowngrade(
|
|||||||
// loop
|
// loop
|
||||||
aLoadState->SetIsExemptFromHTTPSFirstMode(true);
|
aLoadState->SetIsExemptFromHTTPSFirstMode(true);
|
||||||
|
|
||||||
|
// we can safely set the flag to indicate the downgrade here and it will be
|
||||||
|
// propagated all the way to nsHttpChannel::OnStopRequest() where we collect
|
||||||
|
// the telemetry.
|
||||||
|
nsCOMPtr<nsIChannel> channel = aDocumentLoadListener->GetChannel();
|
||||||
|
nsCOMPtr<nsILoadInfo> loadInfo = channel->LoadInfo();
|
||||||
|
if (loadInfo->GetWasSchemelessInput()) {
|
||||||
|
aLoadState->SetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPS_FIRST_SCHEMELESS_UPGRADE_DOWNGRADE);
|
||||||
|
} else {
|
||||||
|
aLoadState->SetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPS_FIRST_UPGRADE_DOWNGRADE);
|
||||||
|
}
|
||||||
|
|
||||||
// Add downgrade data for later telemetry usage to load state
|
// Add downgrade data for later telemetry usage to load state
|
||||||
nsDOMNavigationTiming* timing = aDocumentLoadListener->GetTiming();
|
nsDOMNavigationTiming* timing = aDocumentLoadListener->GetTiming();
|
||||||
if (timing) {
|
if (timing) {
|
||||||
@@ -596,9 +609,6 @@ void nsHTTPSOnlyUtils::UpdateLoadStateAfterHTTPSFirstDowngrade(
|
|||||||
mozilla::TimeDuration duration =
|
mozilla::TimeDuration duration =
|
||||||
mozilla::TimeStamp::Now() - navigationStart;
|
mozilla::TimeStamp::Now() - navigationStart;
|
||||||
|
|
||||||
nsCOMPtr<nsIChannel> channel = aDocumentLoadListener->GetChannel();
|
|
||||||
nsCOMPtr<nsILoadInfo> loadInfo = channel->LoadInfo();
|
|
||||||
|
|
||||||
bool isPrivateWin =
|
bool isPrivateWin =
|
||||||
loadInfo->GetOriginAttributes().mPrivateBrowsingId > 0;
|
loadInfo->GetOriginAttributes().mPrivateBrowsingId > 0;
|
||||||
bool isSchemeless =
|
bool isSchemeless =
|
||||||
|
|||||||
@@ -576,10 +576,10 @@ nsresult LoadInfoToLoadInfoArgs(nsILoadInfo* aLoadInfo,
|
|||||||
aLoadInfo->GetIsFormSubmission(), aLoadInfo->GetSendCSPViolationEvents(),
|
aLoadInfo->GetIsFormSubmission(), aLoadInfo->GetSendCSPViolationEvents(),
|
||||||
aLoadInfo->GetOriginAttributes(), redirectChainIncludingInternalRedirects,
|
aLoadInfo->GetOriginAttributes(), redirectChainIncludingInternalRedirects,
|
||||||
redirectChain, aLoadInfo->GetHasInjectedCookieForCookieBannerHandling(),
|
redirectChain, aLoadInfo->GetHasInjectedCookieForCookieBannerHandling(),
|
||||||
aLoadInfo->GetWasSchemelessInput(), ipcClientInfo, ipcReservedClientInfo,
|
aLoadInfo->GetWasSchemelessInput(), aLoadInfo->GetHttpsUpgradeTelemetry(),
|
||||||
ipcInitialClientInfo, ipcController, aLoadInfo->CorsUnsafeHeaders(),
|
ipcClientInfo, ipcReservedClientInfo, ipcInitialClientInfo, ipcController,
|
||||||
aLoadInfo->GetForcePreflight(), aLoadInfo->GetIsPreflight(),
|
aLoadInfo->CorsUnsafeHeaders(), aLoadInfo->GetForcePreflight(),
|
||||||
aLoadInfo->GetLoadTriggeredFromExternal(),
|
aLoadInfo->GetIsPreflight(), aLoadInfo->GetLoadTriggeredFromExternal(),
|
||||||
aLoadInfo->GetServiceWorkerTaintingSynthesized(),
|
aLoadInfo->GetServiceWorkerTaintingSynthesized(),
|
||||||
aLoadInfo->GetDocumentHasUserInteracted(),
|
aLoadInfo->GetDocumentHasUserInteracted(),
|
||||||
aLoadInfo->GetAllowListFutureDocumentsCreatedFromThisRedirectChain(),
|
aLoadInfo->GetAllowListFutureDocumentsCreatedFromThisRedirectChain(),
|
||||||
@@ -885,7 +885,7 @@ nsresult LoadInfoArgsToLoadInfo(const LoadInfoArgs& loadInfoArgs,
|
|||||||
loadInfoArgs.originTrialCoepCredentiallessEnabledForTopLevel(),
|
loadInfoArgs.originTrialCoepCredentiallessEnabledForTopLevel(),
|
||||||
loadInfoArgs.unstrippedURI(), interceptionInfo,
|
loadInfoArgs.unstrippedURI(), interceptionInfo,
|
||||||
loadInfoArgs.hasInjectedCookieForCookieBannerHandling(),
|
loadInfoArgs.hasInjectedCookieForCookieBannerHandling(),
|
||||||
loadInfoArgs.wasSchemelessInput());
|
loadInfoArgs.wasSchemelessInput(), loadInfoArgs.httpsUpgradeTelemetry());
|
||||||
|
|
||||||
if (loadInfoArgs.isFromProcessingFrameAttributes()) {
|
if (loadInfoArgs.isFromProcessingFrameAttributes()) {
|
||||||
loadInfo->SetIsFromProcessingFrameAttributes();
|
loadInfo->SetIsFromProcessingFrameAttributes();
|
||||||
@@ -953,6 +953,7 @@ void LoadInfoToParentLoadInfoForwarder(
|
|||||||
*aForwarderArgsOut = ParentLoadInfoForwarderArgs(
|
*aForwarderArgsOut = ParentLoadInfoForwarderArgs(
|
||||||
aLoadInfo->GetAllowInsecureRedirectToDataURI(), ipcController, tainting,
|
aLoadInfo->GetAllowInsecureRedirectToDataURI(), ipcController, tainting,
|
||||||
aLoadInfo->GetSkipContentSniffing(), aLoadInfo->GetHttpsOnlyStatus(),
|
aLoadInfo->GetSkipContentSniffing(), aLoadInfo->GetHttpsOnlyStatus(),
|
||||||
|
aLoadInfo->GetWasSchemelessInput(), aLoadInfo->GetHttpsUpgradeTelemetry(),
|
||||||
aLoadInfo->GetHstsStatus(), aLoadInfo->GetHasValidUserGestureActivation(),
|
aLoadInfo->GetHstsStatus(), aLoadInfo->GetHasValidUserGestureActivation(),
|
||||||
aLoadInfo->GetAllowDeprecatedSystemRequests(),
|
aLoadInfo->GetAllowDeprecatedSystemRequests(),
|
||||||
aLoadInfo->GetIsInDevToolsContext(), aLoadInfo->GetParserCreatedScript(),
|
aLoadInfo->GetIsInDevToolsContext(), aLoadInfo->GetParserCreatedScript(),
|
||||||
@@ -995,6 +996,13 @@ nsresult MergeParentLoadInfoForwarder(
|
|||||||
rv = aLoadInfo->SetHttpsOnlyStatus(aForwarderArgs.httpsOnlyStatus());
|
rv = aLoadInfo->SetHttpsOnlyStatus(aForwarderArgs.httpsOnlyStatus());
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
rv = aLoadInfo->SetWasSchemelessInput(aForwarderArgs.wasSchemelessInput());
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
rv = aLoadInfo->SetHttpsUpgradeTelemetry(
|
||||||
|
aForwarderArgs.httpsUpgradeTelemetry());
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = aLoadInfo->SetHstsStatus(aForwarderArgs.hstsStatus());
|
rv = aLoadInfo->SetHstsStatus(aForwarderArgs.hstsStatus());
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
|||||||
@@ -689,7 +689,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
|
|||||||
mInterceptionInfo(rhs.mInterceptionInfo),
|
mInterceptionInfo(rhs.mInterceptionInfo),
|
||||||
mHasInjectedCookieForCookieBannerHandling(
|
mHasInjectedCookieForCookieBannerHandling(
|
||||||
rhs.mHasInjectedCookieForCookieBannerHandling),
|
rhs.mHasInjectedCookieForCookieBannerHandling),
|
||||||
mWasSchemelessInput(rhs.mWasSchemelessInput) {
|
mWasSchemelessInput(rhs.mWasSchemelessInput),
|
||||||
|
mHttpsUpgradeTelemetry(rhs.mHttpsUpgradeTelemetry) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadInfo::LoadInfo(
|
LoadInfo::LoadInfo(
|
||||||
@@ -736,7 +737,8 @@ LoadInfo::LoadInfo(
|
|||||||
nsILoadInfo::CrossOriginEmbedderPolicy aLoadingEmbedderPolicy,
|
nsILoadInfo::CrossOriginEmbedderPolicy aLoadingEmbedderPolicy,
|
||||||
bool aIsOriginTrialCoepCredentiallessEnabledForTopLevel,
|
bool aIsOriginTrialCoepCredentiallessEnabledForTopLevel,
|
||||||
nsIURI* aUnstrippedURI, nsIInterceptionInfo* aInterceptionInfo,
|
nsIURI* aUnstrippedURI, nsIInterceptionInfo* aInterceptionInfo,
|
||||||
bool aHasInjectedCookieForCookieBannerHandling, bool aWasSchemelessInput)
|
bool aHasInjectedCookieForCookieBannerHandling, bool aWasSchemelessInput,
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType aHttpsUpgradeTelemetry)
|
||||||
: mLoadingPrincipal(aLoadingPrincipal),
|
: mLoadingPrincipal(aLoadingPrincipal),
|
||||||
mTriggeringPrincipal(aTriggeringPrincipal),
|
mTriggeringPrincipal(aTriggeringPrincipal),
|
||||||
mPrincipalToInherit(aPrincipalToInherit),
|
mPrincipalToInherit(aPrincipalToInherit),
|
||||||
@@ -814,7 +816,8 @@ LoadInfo::LoadInfo(
|
|||||||
mInterceptionInfo(aInterceptionInfo),
|
mInterceptionInfo(aInterceptionInfo),
|
||||||
mHasInjectedCookieForCookieBannerHandling(
|
mHasInjectedCookieForCookieBannerHandling(
|
||||||
aHasInjectedCookieForCookieBannerHandling),
|
aHasInjectedCookieForCookieBannerHandling),
|
||||||
mWasSchemelessInput(aWasSchemelessInput) {
|
mWasSchemelessInput(aWasSchemelessInput),
|
||||||
|
mHttpsUpgradeTelemetry(aHttpsUpgradeTelemetry) {
|
||||||
// Only top level TYPE_DOCUMENT loads can have a null loadingPrincipal
|
// Only top level TYPE_DOCUMENT loads can have a null loadingPrincipal
|
||||||
MOZ_ASSERT(mLoadingPrincipal ||
|
MOZ_ASSERT(mLoadingPrincipal ||
|
||||||
aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT);
|
aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT);
|
||||||
@@ -2405,4 +2408,18 @@ LoadInfo::SetWasSchemelessInput(bool aWasSchemelessInput) {
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
LoadInfo::GetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType* aOutHttpsUpgradeTelemetry) {
|
||||||
|
*aOutHttpsUpgradeTelemetry = mHttpsUpgradeTelemetry;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
LoadInfo::SetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType aHttpsUpgradeTelemetry) {
|
||||||
|
mHttpsUpgradeTelemetry = aHttpsUpgradeTelemetry;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace mozilla::net
|
} // namespace mozilla::net
|
||||||
|
|||||||
@@ -252,7 +252,9 @@ class LoadInfo final : public nsILoadInfo {
|
|||||||
nsILoadInfo::CrossOriginEmbedderPolicy aLoadingEmbedderPolicy,
|
nsILoadInfo::CrossOriginEmbedderPolicy aLoadingEmbedderPolicy,
|
||||||
bool aIsOriginTrialCoepCredentiallessEnabledForTopLevel,
|
bool aIsOriginTrialCoepCredentiallessEnabledForTopLevel,
|
||||||
nsIURI* aUnstrippedURI, nsIInterceptionInfo* aInterceptionInfo,
|
nsIURI* aUnstrippedURI, nsIInterceptionInfo* aInterceptionInfo,
|
||||||
bool aHasInjectedCookieForCookieBannerHandling, bool aWasSchemelessInput);
|
bool aHasInjectedCookieForCookieBannerHandling, bool aWasSchemelessInput,
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType aHttpsUpgradeTelemetry);
|
||||||
|
|
||||||
LoadInfo(const LoadInfo& rhs);
|
LoadInfo(const LoadInfo& rhs);
|
||||||
|
|
||||||
NS_IMETHOD GetRedirects(JSContext* aCx,
|
NS_IMETHOD GetRedirects(JSContext* aCx,
|
||||||
@@ -401,6 +403,9 @@ class LoadInfo final : public nsILoadInfo {
|
|||||||
|
|
||||||
bool mHasInjectedCookieForCookieBannerHandling = false;
|
bool mHasInjectedCookieForCookieBannerHandling = false;
|
||||||
bool mWasSchemelessInput = false;
|
bool mWasSchemelessInput = false;
|
||||||
|
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType mHttpsUpgradeTelemetry =
|
||||||
|
nsILoadInfo::NO_UPGRADE;
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is exposed solely for testing purposes and should not be used outside of
|
// This is exposed solely for testing purposes and should not be used outside of
|
||||||
|
|||||||
@@ -861,5 +861,17 @@ TRRLoadInfo::SetWasSchemelessInput(bool aWasSchemelessInput) {
|
|||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
TRRLoadInfo::GetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType* aOutHttpsTelemetry) {
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
TRRLoadInfo::SetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType aHttpsTelemetry) {
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace net
|
} // namespace net
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -1532,4 +1532,23 @@ interface nsILoadInfo : nsISupports
|
|||||||
* Whether the load has gone through the URL bar, where the fixup had to add * the protocol scheme.
|
* Whether the load has gone through the URL bar, where the fixup had to add * the protocol scheme.
|
||||||
*/
|
*/
|
||||||
[infallible] attribute boolean wasSchemelessInput;
|
[infallible] attribute boolean wasSchemelessInput;
|
||||||
|
|
||||||
|
cenum HTTPSUpgradeTelemetryType : 32 {
|
||||||
|
NO_UPGRADE = 0,
|
||||||
|
ALREADY_HTTPS = (1 << 0),
|
||||||
|
HSTS = (1 << 1),
|
||||||
|
HTTPS_ONLY_UPGRADE = (1 << 2),
|
||||||
|
HTTPS_ONLY_UPGRADE_DOWNGRADE = (1 << 3),
|
||||||
|
HTTPS_FIRST_UPGRADE = (1 << 4),
|
||||||
|
HTTPS_FIRST_UPGRADE_DOWNGRADE = (1 << 5),
|
||||||
|
HTTPS_FIRST_SCHEMELESS_UPGRADE = (1 << 6),
|
||||||
|
HTTPS_FIRST_SCHEMELESS_UPGRADE_DOWNGRADE = (1 << 7),
|
||||||
|
HTTPS_RR = (1 << 8),
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Solely for the use of collecting Telemetry for HTTPS upgrades.
|
||||||
|
*/
|
||||||
|
[infallible] attribute nsILoadInfo_HTTPSUpgradeTelemetryType httpsUpgradeTelemetry;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2931,15 +2931,8 @@ bool handleResultFunc(bool aAllowSTS, bool aIsStsHost) {
|
|||||||
if (aIsStsHost) {
|
if (aIsStsHost) {
|
||||||
LOG(("nsHttpChannel::Connect() STS permissions found\n"));
|
LOG(("nsHttpChannel::Connect() STS permissions found\n"));
|
||||||
if (aAllowSTS) {
|
if (aAllowSTS) {
|
||||||
Telemetry::AccumulateCategorical(
|
|
||||||
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::STS);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Telemetry::AccumulateCategorical(
|
|
||||||
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::PrefBlockedSTS);
|
|
||||||
} else {
|
|
||||||
Telemetry::AccumulateCategorical(
|
|
||||||
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::NoReasonToUpgrade);
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
@@ -2966,8 +2959,6 @@ static bool ShouldSecureUpgradeNoHSTS(nsIURI* aURI, nsILoadInfo* aLoadInfo) {
|
|||||||
nsIScriptError::warningFlag,
|
nsIScriptError::warningFlag,
|
||||||
"upgradeInsecureRequest"_ns, innerWindowId,
|
"upgradeInsecureRequest"_ns, innerWindowId,
|
||||||
!!aLoadInfo->GetOriginAttributes().mPrivateBrowsingId);
|
!!aLoadInfo->GetOriginAttributes().mPrivateBrowsingId);
|
||||||
Telemetry::AccumulateCategorical(
|
|
||||||
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::CSP);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// 3. Mixed content auto upgrading
|
// 3. Mixed content auto upgrading
|
||||||
@@ -2999,22 +2990,22 @@ static bool ShouldSecureUpgradeNoHSTS(nsIURI* aURI, nsILoadInfo* aLoadInfo) {
|
|||||||
// Set this flag so we know we'll upgrade because of
|
// Set this flag so we know we'll upgrade because of
|
||||||
// 'security.mixed_content.upgrade_display_content'.
|
// 'security.mixed_content.upgrade_display_content'.
|
||||||
aLoadInfo->SetBrowserDidUpgradeInsecureRequests(true);
|
aLoadInfo->SetBrowserDidUpgradeInsecureRequests(true);
|
||||||
Telemetry::AccumulateCategorical(
|
|
||||||
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::BrowserDisplay);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Https-Only
|
// 4. Https-Only
|
||||||
if (nsHTTPSOnlyUtils::ShouldUpgradeRequest(aURI, aLoadInfo)) {
|
if (nsHTTPSOnlyUtils::ShouldUpgradeRequest(aURI, aLoadInfo)) {
|
||||||
Telemetry::AccumulateCategorical(
|
aLoadInfo->SetHttpsUpgradeTelemetry(nsILoadInfo::HTTPS_ONLY_UPGRADE);
|
||||||
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::HTTPSOnly);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// 4.a Https-First
|
// 4.a Https-First
|
||||||
if (nsHTTPSOnlyUtils::ShouldUpgradeHttpsFirstRequest(aURI, aLoadInfo)) {
|
if (nsHTTPSOnlyUtils::ShouldUpgradeHttpsFirstRequest(aURI, aLoadInfo)) {
|
||||||
Telemetry::AccumulateCategorical(
|
if (aLoadInfo->GetWasSchemelessInput()) {
|
||||||
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::HTTPSFirst);
|
aLoadInfo->SetHttpsUpgradeTelemetry(
|
||||||
|
nsILoadInfo::HTTPS_FIRST_SCHEMELESS_UPGRADE);
|
||||||
|
} else {
|
||||||
|
aLoadInfo->SetHttpsUpgradeTelemetry(nsILoadInfo::HTTPS_FIRST_UPGRADE);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -3047,8 +3038,7 @@ nsresult NS_ShouldSecureUpgrade(
|
|||||||
|
|
||||||
// If request is https, then there is nothing to do here.
|
// If request is https, then there is nothing to do here.
|
||||||
if (isHttps) {
|
if (isHttps) {
|
||||||
Telemetry::AccumulateCategorical(
|
aLoadInfo->SetHttpsUpgradeTelemetry(nsILoadInfo::ALREADY_HTTPS);
|
||||||
Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::AlreadyHTTPS);
|
|
||||||
aShouldUpgrade = false;
|
aShouldUpgrade = false;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -3131,6 +3121,11 @@ nsresult NS_ShouldSecureUpgrade(
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
aShouldUpgrade = handleResultFunc(aAllowSTS, isStsHost);
|
aShouldUpgrade = handleResultFunc(aAllowSTS, isStsHost);
|
||||||
|
// we can't pass the loadinfo to handleResultFunc since it's not threadsafe
|
||||||
|
// hence we set the http telemetry information on the loadinfo here.
|
||||||
|
if (aShouldUpgrade) {
|
||||||
|
aLoadInfo->SetHttpsUpgradeTelemetry(nsILoadInfo::HSTS);
|
||||||
|
}
|
||||||
if (!aShouldUpgrade) {
|
if (!aShouldUpgrade) {
|
||||||
// Check for CSP upgrade-insecure-requests, Mixed content auto upgrading
|
// Check for CSP upgrade-insecure-requests, Mixed content auto upgrading
|
||||||
// and Https-Only / -First.
|
// and Https-Only / -First.
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
loadInfo->SetWasSchemelessInput(aLoadState->GetWasSchemelessInput());
|
loadInfo->SetWasSchemelessInput(aLoadState->GetWasSchemelessInput());
|
||||||
|
loadInfo->SetHttpsUpgradeTelemetry(aLoadState->GetHttpsUpgradeTelemetry());
|
||||||
|
|
||||||
loadInfo->SetTriggeringSandboxFlags(aLoadState->TriggeringSandboxFlags());
|
loadInfo->SetTriggeringSandboxFlags(aLoadState->TriggeringSandboxFlags());
|
||||||
loadInfo->SetTriggeringWindowId(aLoadState->TriggeringWindowId());
|
loadInfo->SetTriggeringWindowId(aLoadState->TriggeringWindowId());
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ include PBackgroundSharedTypes;
|
|||||||
include DOMTypes;
|
include DOMTypes;
|
||||||
include ProtocolTypes;
|
include ProtocolTypes;
|
||||||
|
|
||||||
|
include "mozilla/dom/DomSecurityIPCUtils.h";
|
||||||
include "mozilla/dom/FetchIPCTypes.h";
|
include "mozilla/dom/FetchIPCTypes.h";
|
||||||
include "mozilla/dom/PropertyBagUtils.h";
|
include "mozilla/dom/PropertyBagUtils.h";
|
||||||
include "mozilla/dom/ReferrerInfoUtils.h";
|
include "mozilla/dom/ReferrerInfoUtils.h";
|
||||||
@@ -37,6 +38,7 @@ using nsILoadInfo::StoragePermissionState from "nsILoadInfo.h";
|
|||||||
using struct mozilla::dom::LoadingSessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
|
using struct mozilla::dom::LoadingSessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
|
||||||
using mozilla::dom::RequestMode from "mozilla/dom/RequestBinding.h";
|
using mozilla::dom::RequestMode from "mozilla/dom/RequestBinding.h";
|
||||||
using mozilla::net::LinkHeader from "nsNetUtil.h";
|
using mozilla::net::LinkHeader from "nsNetUtil.h";
|
||||||
|
using nsILoadInfo::HTTPSUpgradeTelemetryType from "nsILoadInfo.h";
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace net {
|
namespace net {
|
||||||
@@ -135,6 +137,7 @@ struct LoadInfoArgs
|
|||||||
RedirectHistoryEntryInfo[] redirectChain;
|
RedirectHistoryEntryInfo[] redirectChain;
|
||||||
bool hasInjectedCookieForCookieBannerHandling;
|
bool hasInjectedCookieForCookieBannerHandling;
|
||||||
bool wasSchemelessInput;
|
bool wasSchemelessInput;
|
||||||
|
HTTPSUpgradeTelemetryType httpsUpgradeTelemetry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClientInfo structure representing the window or worker that triggered
|
* ClientInfo structure representing the window or worker that triggered
|
||||||
@@ -221,6 +224,10 @@ struct ParentLoadInfoForwarderArgs
|
|||||||
|
|
||||||
uint32_t httpsOnlyStatus;
|
uint32_t httpsOnlyStatus;
|
||||||
|
|
||||||
|
bool wasSchemelessInput;
|
||||||
|
|
||||||
|
HTTPSUpgradeTelemetryType httpsUpgradeTelemetry;
|
||||||
|
|
||||||
bool hstsStatus;
|
bool hstsStatus;
|
||||||
|
|
||||||
// Returns true if at the time of the loadinfo construction the document
|
// Returns true if at the time of the loadinfo construction the document
|
||||||
|
|||||||
@@ -933,22 +933,6 @@ networking:
|
|||||||
- presented_with_http3
|
- presented_with_http3
|
||||||
- none
|
- none
|
||||||
|
|
||||||
https_upgrade_with_https_rr:
|
|
||||||
type: labeled_counter
|
|
||||||
description: >
|
|
||||||
Whether an HTTP request gets upgraded to HTTPS because of HTTPS RR
|
|
||||||
bugs:
|
|
||||||
- https://bugzilla.mozilla.org/1686421
|
|
||||||
data_reviews:
|
|
||||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1686421
|
|
||||||
notification_emails:
|
|
||||||
- necko@mozilla.com
|
|
||||||
- kershaw@mozilla.com
|
|
||||||
expires: never
|
|
||||||
labels:
|
|
||||||
- https_rr
|
|
||||||
- others
|
|
||||||
|
|
||||||
http_channel_onstart_success_https_rr:
|
http_channel_onstart_success_https_rr:
|
||||||
type: labeled_counter
|
type: labeled_counter
|
||||||
description: >
|
description: >
|
||||||
@@ -1105,6 +1089,33 @@ networking:
|
|||||||
- kershaw@mozilla.com
|
- kershaw@mozilla.com
|
||||||
expires: never
|
expires: never
|
||||||
|
|
||||||
|
http_to_https_upgrade_reason:
|
||||||
|
type: labeled_counter
|
||||||
|
description: >
|
||||||
|
Whether a top-level HTTP request gets upgraded to HTTPS and the reason for it
|
||||||
|
bugs:
|
||||||
|
- https://bugzilla.mozilla.org/show_bug.cgi?id=1883954
|
||||||
|
data_reviews:
|
||||||
|
- https://bugzilla.mozilla.org/show_bug.cgi?id=1883954
|
||||||
|
notification_emails:
|
||||||
|
- ckerschb@mozilla.com
|
||||||
|
- freddyb@mozilla.com
|
||||||
|
- kershaw@mozilla.com
|
||||||
|
- necko@mozilla.com
|
||||||
|
- seceng-telemetry@mozilla.com
|
||||||
|
expires: never
|
||||||
|
labels:
|
||||||
|
- no_upgrade
|
||||||
|
- already_https
|
||||||
|
- hsts
|
||||||
|
- https_only_upgrade
|
||||||
|
- https_only_upgrade_downgrade
|
||||||
|
- https_first_upgrade
|
||||||
|
- https_first_upgrade_downgrade
|
||||||
|
- https_first_schemeless_upgrade
|
||||||
|
- https_first_schemeless_upgrade_downgrade
|
||||||
|
- https_rr
|
||||||
|
|
||||||
http_channel_sub_open_to_first_sent_https_rr:
|
http_channel_sub_open_to_first_sent_https_rr:
|
||||||
type: timing_distribution
|
type: timing_distribution
|
||||||
time_unit: millisecond
|
time_unit: millisecond
|
||||||
|
|||||||
@@ -794,9 +794,12 @@ nsresult nsHttpChannel::ContinueOnBeforeConnect(bool aShouldUpgrade,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (aShouldUpgrade && !mURI->SchemeIs("https")) {
|
if (aShouldUpgrade && !mURI->SchemeIs("https")) {
|
||||||
mozilla::glean::networking::https_upgrade_with_https_rr
|
// only set HTTPS_RR to be responsbile for the upgrade in the loadinfo
|
||||||
.Get(aUpgradeWithHTTPSRR ? "https_rr"_ns : "others"_ns)
|
// if it actually was responsible, otherwise the correct flag is
|
||||||
.Add(1);
|
// already present in the loadinfo.
|
||||||
|
if (aUpgradeWithHTTPSRR) {
|
||||||
|
mLoadInfo->SetHttpsUpgradeTelemetry(nsILoadInfo::HTTPS_RR);
|
||||||
|
}
|
||||||
return AsyncCall(&nsHttpChannel::HandleAsyncRedirectChannelToHttps);
|
return AsyncCall(&nsHttpChannel::HandleAsyncRedirectChannelToHttps);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7941,6 +7944,71 @@ nsresult nsHttpChannel::LogConsoleError(const char* aTag) {
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void RecordHTTPSUpgradeTelemetry(nsILoadInfo* aLoadInfo) {
|
||||||
|
// we record https telemetry only for top-level loads
|
||||||
|
if (aLoadInfo->GetExternalContentPolicyType() !=
|
||||||
|
ExtContentPolicy::TYPE_DOCUMENT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsILoadInfo::HTTPSUpgradeTelemetryType httpsTelemetry =
|
||||||
|
nsILoadInfo::NO_UPGRADE;
|
||||||
|
aLoadInfo->GetHttpsUpgradeTelemetry(&httpsTelemetry);
|
||||||
|
switch (httpsTelemetry) {
|
||||||
|
case nsILoadInfo::NO_UPGRADE:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("no_upgrade"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::ALREADY_HTTPS:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("already_https"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::HSTS:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason.Get("hsts"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::HTTPS_ONLY_UPGRADE:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("https_only_upgrade"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::HTTPS_ONLY_UPGRADE_DOWNGRADE:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("https_only_upgrade_downgrade"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::HTTPS_FIRST_UPGRADE:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("https_first_upgrade"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::HTTPS_FIRST_UPGRADE_DOWNGRADE:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("https_first_upgrade_downgrade"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::HTTPS_FIRST_SCHEMELESS_UPGRADE:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("https_first_schemeless_upgrade"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::HTTPS_FIRST_SCHEMELESS_UPGRADE_DOWNGRADE:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("https_first_schemeless_upgrade_downgrade"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
case nsILoadInfo::HTTPS_RR:
|
||||||
|
mozilla::glean::networking::http_to_https_upgrade_reason
|
||||||
|
.Get("https_rr"_ns)
|
||||||
|
.Add(1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
MOZ_ASSERT(false, "what telemetry flag is set to end up here?");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHttpChannel::OnStopRequest(nsIRequest* request, nsresult status) {
|
nsHttpChannel::OnStopRequest(nsIRequest* request, nsresult status) {
|
||||||
AUTO_PROFILER_LABEL("nsHttpChannel::OnStopRequest", NETWORK);
|
AUTO_PROFILER_LABEL("nsHttpChannel::OnStopRequest", NETWORK);
|
||||||
@@ -8096,6 +8164,8 @@ nsHttpChannel::OnStopRequest(nsIRequest* request, nsresult status) {
|
|||||||
mozilla::glean::network::data_size_per_type.Get(label).Add(totalSize);
|
mozilla::glean::network::data_size_per_type.Get(label).Add(totalSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RecordHTTPSUpgradeTelemetry(mLoadInfo);
|
||||||
|
|
||||||
// If we are using the transaction to serve content, we also save the
|
// 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 telemetry
|
||||||
// between cache and net response.
|
// between cache and net response.
|
||||||
|
|||||||
@@ -3026,26 +3026,6 @@
|
|||||||
"kind": "boolean",
|
"kind": "boolean",
|
||||||
"description": "Whether or not a new alt-svc mapping would change the target hostname of the existing mapping"
|
"description": "Whether or not a new alt-svc mapping would change the target hostname of the existing mapping"
|
||||||
},
|
},
|
||||||
"HTTP_SCHEME_UPGRADE_TYPE": {
|
|
||||||
"record_in_processes": ["main", "content"],
|
|
||||||
"products": ["firefox", "fennec"],
|
|
||||||
"alert_emails": ["seceng-telemetry@mozilla.com", "freddyb@mozilla.com"],
|
|
||||||
"bug_numbers": [1340021, 1435733, 1722895],
|
|
||||||
"releaseChannelCollection": "opt-out",
|
|
||||||
"expires_in_version": "never",
|
|
||||||
"kind": "categorical",
|
|
||||||
"labels": [
|
|
||||||
"AlreadyHTTPS",
|
|
||||||
"NoReasonToUpgrade",
|
|
||||||
"PrefBlockedSTS",
|
|
||||||
"STS",
|
|
||||||
"CSP",
|
|
||||||
"BrowserDisplay",
|
|
||||||
"HTTPSOnly",
|
|
||||||
"HTTPSFirst"
|
|
||||||
],
|
|
||||||
"description": "Was the URL upgraded to HTTPS?"
|
|
||||||
},
|
|
||||||
"HTTP_RESPONSE_STATUS_CODE": {
|
"HTTP_RESPONSE_STATUS_CODE": {
|
||||||
"record_in_processes": ["main", "content"],
|
"record_in_processes": ["main", "content"],
|
||||||
"products": ["firefox", "fennec"],
|
"products": ["firefox", "fennec"],
|
||||||
|
|||||||
Reference in New Issue
Block a user