From 3d6e94c203db44ddb75634fa0283907555edf79c Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Thu, 8 Sep 2016 09:29:17 +0200 Subject: [PATCH] Bug 1300891 - Rename SCRIPT_BLOCK_WRONG_MIME to avoid confusing the telemetry probe. r=gfritzsche --- netwerk/protocol/http/nsHttpChannel.cpp | 24 ++++++++++---------- toolkit/components/telemetry/Histograms.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 74a80b9bbabe..bcee67b645d6 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -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; } diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 49d76fd69721..7be5285f247d 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -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",