Bug 1299267 - Add additonal telemetry types. r=ckerschb

This commit is contained in:
Tom Schuster 2016-09-05 20:02:52 +02:00
parent 885c81fd09
commit e92a8267c7
2 changed files with 15 additions and 3 deletions

View File

@ -1133,6 +1133,18 @@ EnsureMIMEOfScript(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo*
return NS_OK;
}
if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("text/html"))) {
// script load has type text/html
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 10);
return NS_OK;
}
if (contentType.IsEmpty()) {
// script load has no type
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 11);
return NS_OK;
}
// script load has unknown type
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 0);
return NS_OK;

View File

@ -5524,11 +5524,11 @@
},
"SCRIPT_BLOCK_WRONG_MIME": {
"alert_emails": ["ckerschbaumer@mozilla.com"],
"bug_numbers": [1288361],
"bug_numbers": [1288361, 1299267],
"expires_in_version": "56",
"kind": "enumerated",
"n_values": 10,
"description": "Whether the script load has a MIME type of ...? (0=unknown, 1=js, 2=image, 3=audio, 4=video, 5=text/plain, 6=text/csv, 7=text/xml, 8=application/octet-stream, 9=application/xml)"
"n_values": 15,
"description": "Whether the script load has a MIME type of ...? (0=unknown, 1=js, 2=image, 3=audio, 4=video, 5=text/plain, 6=text/csv, 7=text/xml, 8=application/octet-stream, 9=application/xml, 10=text/html, 11=empty)"
},
"NEWTAB_PAGE_ENABLED": {
"expires_in_version": "default",