Bug 1885893 - Only collect HTTPS-First telemetry on successful request r=freddyb
This patch addresses the problem that we currently collect HTTPS-First telemetry for sites that are not reachable at all, be it through always causing a error or through always timing out. - On a downgrade, do not collect telemetry instantly, but instead save the telemetry data in the load state for the downgraded request - That telemetry data will then be copied over into the document load listener of the new request - On a successful request, if we have downgrade data in the load listener, we collect the downgrade telemetry, as the downgrade seems to have been successful - Similar to the downgrade case, we only count the upgrade metric once we encounter a successful request annotated with the information that it was upgraded by HTTPS-First, instead of counting it instantly on the decision to upgrade. This also means the upgrade metric will not include loads that are downgraded again anymore - Add a testcase for a site which is neither reachable via HTTP nor HTTPS, and ensure no telemetry is collected Differential Revision: https://phabricator.services.mozilla.com/D210792
This commit is contained in:
@@ -24,6 +24,7 @@ class nsIURI;
|
||||
class nsIDocShell;
|
||||
class nsIChannel;
|
||||
class nsIReferrerInfo;
|
||||
struct HTTPSFirstDowngradeData;
|
||||
namespace mozilla {
|
||||
class OriginAttributes;
|
||||
template <typename, class>
|
||||
@@ -148,6 +149,11 @@ class nsDocShellLoadState final {
|
||||
|
||||
void SetIsExemptFromHTTPSFirstMode(bool aIsExemptFromHTTPSFirstMode);
|
||||
|
||||
RefPtr<HTTPSFirstDowngradeData> GetHttpsFirstDowngradeData() const;
|
||||
|
||||
void SetHttpsFirstDowngradeData(
|
||||
RefPtr<HTTPSFirstDowngradeData> const& aHttpsFirstTelemetryData);
|
||||
|
||||
bool OriginalFrameSrc() const;
|
||||
|
||||
void SetOriginalFrameSrc(bool aOriginalFrameSrc);
|
||||
@@ -484,6 +490,10 @@ class nsDocShellLoadState final {
|
||||
// will be exempt from HTTPS-Only-Mode upgrades.
|
||||
bool mIsExemptFromHTTPSFirstMode;
|
||||
|
||||
// If set, this load is a HTTPS-First downgrade, and the downgrade data will
|
||||
// be submitted to telemetry later if the load succeeds.
|
||||
RefPtr<HTTPSFirstDowngradeData> mHttpsFirstDowngradeData;
|
||||
|
||||
// If this attribute is true, this load corresponds to a frame
|
||||
// element loading its original src (or srcdoc) attribute.
|
||||
bool mOriginalFrameSrc;
|
||||
|
||||
Reference in New Issue
Block a user