зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1046006 - Remove telemetry for JS versions (JS_MINOR_VERSION). r=till
This commit is contained in:
Родитель
c81918a3f8
Коммит
c45b49542e
|
@ -53,7 +53,6 @@
|
|||
|
||||
#include "mozilla/CORSMode.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
|
@ -545,43 +544,6 @@ CSPAllowsInlineScript(nsIScriptElement *aElement, nsIDocument *aDocument)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
AccumulateJavaScriptVersionTelemetry(nsIScriptElement* aElement,
|
||||
JSVersion aVersion)
|
||||
{
|
||||
uint32_t minorVersion;
|
||||
switch (aVersion) {
|
||||
case JSVERSION_DEFAULT: minorVersion = 5; break;
|
||||
case JSVERSION_1_6: minorVersion = 6; break;
|
||||
case JSVERSION_1_7: minorVersion = 7; break;
|
||||
case JSVERSION_1_8: minorVersion = 8; break;
|
||||
default: MOZ_ASSERT_UNREACHABLE("Unexpected JSVersion");
|
||||
case JSVERSION_UNKNOWN: minorVersion = 0; break;
|
||||
}
|
||||
|
||||
// Only report SpiderMonkey's nonstandard JS versions: 1.6, 1.7, and 1.8.
|
||||
if (minorVersion < 6) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> scriptURI = aElement->GetScriptURI();
|
||||
if (!scriptURI) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We only care about web content, not chrome or add-on JS versions.
|
||||
bool chrome = false;
|
||||
scriptURI->SchemeIs("chrome", &chrome);
|
||||
if (!chrome) {
|
||||
scriptURI->SchemeIs("resource", &chrome);
|
||||
}
|
||||
if (chrome) {
|
||||
return;
|
||||
}
|
||||
|
||||
Telemetry::Accumulate(Telemetry::JS_MINOR_VERSION, minorVersion);
|
||||
}
|
||||
|
||||
bool
|
||||
nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||
{
|
||||
|
@ -610,7 +572,6 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
|||
aElement->GetScriptType(type);
|
||||
if (!type.IsEmpty()) {
|
||||
NS_ENSURE_TRUE(ParseTypeAttribute(type, &version), false);
|
||||
AccumulateJavaScriptVersionTelemetry(aElement, version);
|
||||
} else {
|
||||
// no 'type=' element
|
||||
// "language" is a deprecated attribute of HTML, so we check it only for
|
||||
|
|
|
@ -334,12 +334,6 @@
|
|||
"kind": "flag",
|
||||
"description": "Has seen location error"
|
||||
},
|
||||
"JS_MINOR_VERSION": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "JavaScript version in web content (1.x)"
|
||||
},
|
||||
"TELEMETRY_PING": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
|
|
Загрузка…
Ссылка в новой задаче