Bug 1847539 - Remove the expired document CSP telemetry. r=freddyb

Differential Revision: https://phabricator.services.mozilla.com/D185550
This commit is contained in:
Tom Schuster 2023-08-11 09:20:11 +00:00
parent b8a111d6df
commit 856afead16
6 changed files with 0 additions and 89 deletions

View File

@ -1337,9 +1337,6 @@ Document::Document(const char* aContentType)
mFlushingPendingLinkUpdates(false),
mMayHaveDOMMutationObservers(false),
mMayHaveAnimationObservers(false),
mHasCSP(false),
mHasUnsafeEvalCSP(false),
mHasUnsafeInlineCSP(false),
mHasCSPDeliveredThroughHeader(false),
mBFCacheDisallowed(false),
mHasHadDefaultView(false),
@ -2298,17 +2295,6 @@ Document::~Document() {
// don't report for about: pages
if (!IsAboutPage()) {
// record CSP telemetry on this document
if (mHasCSP) {
Accumulate(Telemetry::CSP_DOCUMENTS_COUNT, 1);
}
if (mHasUnsafeInlineCSP) {
Accumulate(Telemetry::CSP_UNSAFE_INLINE_DOCUMENTS_COUNT, 1);
}
if (mHasUnsafeEvalCSP) {
Accumulate(Telemetry::CSP_UNSAFE_EVAL_DOCUMENTS_COUNT, 1);
}
if (MOZ_UNLIKELY(mMathMLEnabled)) {
ScalarAdd(Telemetry::ScalarID::MATHML_DOC_COUNT, 1);
}

View File

@ -1066,25 +1066,6 @@ class Document : public nsINode,
*/
void SetBidiOptions(uint32_t aBidiOptions) { mBidiOptions = aBidiOptions; }
/**
* Set CSP flag for this document.
*/
void SetHasCSP(bool aHasCSP) { mHasCSP = aHasCSP; }
/**
* Set unsafe-inline CSP flag for this document.
*/
void SetHasUnsafeInlineCSP(bool aHasUnsafeInlineCSP) {
mHasUnsafeInlineCSP = aHasUnsafeInlineCSP;
}
/**
* Set unsafe-eval CSP flag for this document.
*/
void SetHasUnsafeEvalCSP(bool aHasUnsafeEvalCSP) {
mHasUnsafeEvalCSP = aHasUnsafeEvalCSP;
}
/**
* Returns true if the document holds a CSP
* delivered through an HTTP Header.
@ -4679,15 +4660,6 @@ class Document : public nsINode,
// document.
bool mMayHaveAnimationObservers : 1;
// True if a document load has a CSP attached.
bool mHasCSP : 1;
// True if a document load has a CSP with unsafe-eval attached.
bool mHasUnsafeEvalCSP : 1;
// True if a document load has a CSP with unsafe-inline attached.
bool mHasUnsafeInlineCSP : 1;
// True if the document has a CSP delivered throuh a header
bool mHasCSPDeliveredThroughHeader : 1;

View File

@ -462,12 +462,6 @@ nsCSPContext::AppendPolicy(const nsAString& aPolicyString, bool aReportOnly,
}
mPolicies.AppendElement(policy);
// set the flag on the document for CSP telemetry
nsCOMPtr<Document> doc = do_QueryReferent(mLoadingContext);
if (doc) {
doc->SetHasCSP(true);
}
}
return NS_OK;

View File

@ -427,11 +427,6 @@ nsCSPBaseSrc* nsCSPParser::keywordSource() {
}
if (CSP_IsKeyword(mCurToken, CSP_UNSAFE_INLINE)) {
nsWeakPtr ctx = mCSPContext->GetLoadingContext();
nsCOMPtr<Document> doc = do_QueryReferent(ctx);
if (doc) {
doc->SetHasUnsafeInlineCSP(true);
}
// make sure script-src only contains 'unsafe-inline' once;
// ignore duplicates and log warning
if (mUnsafeInlineKeywordSrc) {
@ -448,11 +443,6 @@ nsCSPBaseSrc* nsCSPParser::keywordSource() {
}
if (CSP_IsKeyword(mCurToken, CSP_UNSAFE_EVAL)) {
nsWeakPtr ctx = mCSPContext->GetLoadingContext();
nsCOMPtr<Document> doc = do_QueryReferent(ctx);
if (doc) {
doc->SetHasUnsafeEvalCSP(true);
}
mHasAnyUnsafeEval = true;
return new nsCSPKeywordSrc(CSP_UTF16KeywordToEnum(mCurToken));
}

View File

@ -6818,34 +6818,6 @@
"bug_numbers": [1351147],
"description": "Server HTTP status code from Safe Browsing ThreatHit report. (0=1xx, 1=200, 2=2xx, 3=204, 4=3xx, 5=400, 6=4xx, 7=403, 8=404, 9=408, 10=413, 11=5xx, 12=502|504|511, 13=503, 14=505, 15=Other)"
},
"CSP_DOCUMENTS_COUNT": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec"],
"alert_emails": ["seceng-telemetry@mozilla.com"],
"bug_numbers": [1252829],
"expires_in_version": "65",
"kind": "count",
"description": "Number of unique pages that contain a CSP"
},
"CSP_UNSAFE_INLINE_DOCUMENTS_COUNT": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec"],
"alert_emails": ["seceng-telemetry@mozilla.com"],
"bug_numbers": [1252829],
"expires_in_version": "65",
"kind": "count",
"description": "Number of unique pages that contain an unsafe-inline CSP directive"
},
"CSP_UNSAFE_EVAL_DOCUMENTS_COUNT": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec"],
"alert_emails": ["seceng-telemetry@mozilla.com"],
"bug_numbers": [1252829],
"expires_in_version": "65",
"kind": "count",
"description": "Number of unique pages that contain an unsafe-eval CSP directive"
},
"HTTPS_ONLY_MODE_UPGRADE_TIME_MS": {
"record_in_processes": ["main"],
"products": ["firefox"],

View File

@ -982,9 +982,6 @@
"CHANGES_OF_TARGET_LANGUAGE",
"COMPONENTS_SHIM_ACCESSED_BY_CONTENT",
"CONTENT_DOCUMENTS_DESTROYED",
"CSP_DOCUMENTS_COUNT",
"CSP_UNSAFE_EVAL_DOCUMENTS_COUNT",
"CSP_UNSAFE_INLINE_DOCUMENTS_COUNT",
"CYCLE_COLLECTOR_OOM",
"CYCLE_COLLECTOR_WORKER_OOM",
"D3D11_COMPOSITING_FAILURE_ID",