Bug 1300891 - Rename SCRIPT_BLOCK_WRONG_MIME to avoid confusing the telemetry probe. r=gfritzsche

This commit is contained in:
Christoph Kerschbaumer 2016-09-08 09:29:17 +02:00
parent 33ba2fa9ac
commit 3d6e94c203
2 changed files with 13 additions and 13 deletions

View File

@ -1066,26 +1066,26 @@ EnsureMIMEOfScript(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo*
if (nsContentUtils::IsJavascriptMIMEType(typeString)) {
// script load has type script
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 1);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 1);
return NS_OK;
}
bool block = false;
if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("image/"))) {
// script load has type image
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 2);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 2);
block = true;
} else if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("audio/"))) {
// script load has type audio
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 3);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 3);
block = true;
} else if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("video/"))) {
// script load has type video
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 4);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 4);
block = true;
} else if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("text/csv"))) {
// script load has type text/csv
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 6);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 6);
block = true;
}
@ -1111,42 +1111,42 @@ EnsureMIMEOfScript(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo*
if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("text/plain"))) {
// script load has type text/plain
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 5);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 5);
return NS_OK;
}
if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("text/xml"))) {
// script load has type text/xml
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 7);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 7);
return NS_OK;
}
if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("application/octet-stream"))) {
// script load has type application/octet-stream
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 8);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 8);
return NS_OK;
}
if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("application/xml"))) {
// script load has type application/xml
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 9);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 9);
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);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 10);
return NS_OK;
}
if (contentType.IsEmpty()) {
// script load has no type
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 11);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 11);
return NS_OK;
}
// script load has unknown type
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_WRONG_MIME, 0);
Telemetry::Accumulate(Telemetry::SCRIPT_BLOCK_INCORRECT_MIME, 0);
return NS_OK;
}

View File

@ -5565,7 +5565,7 @@
"n_values": 3,
"description": "Whether the user is in safe mode (No, Yes, Forced)"
},
"SCRIPT_BLOCK_WRONG_MIME": {
"SCRIPT_BLOCK_INCORRECT_MIME": {
"alert_emails": ["ckerschbaumer@mozilla.com"],
"bug_numbers": [1288361, 1299267],
"expires_in_version": "56",