Bug 1211164 - Collect JS deprecated language extension telemetry for Add-ons. r=till,bsmedberg

--HG--
extra : commitid : 7dHndrGepgZ
extra : rebase_source : fd4a16cf3317cf3341dad6e31028cfa80a759933
This commit is contained in:
Tooru Fujisawa 2015-10-04 02:06:54 +09:00
Родитель e2337163c0
Коммит 7c285c44e3
4 изменённых файлов: 21 добавлений и 5 удалений

Просмотреть файл

@ -1123,25 +1123,29 @@ JSCompartment::addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
void
JSCompartment::reportTelemetry()
{
// Only report telemetry for web content, not add-ons or chrome JS.
if (addonId || isSystem_)
// Only report telemetry for web content and add-ons, not chrome JS.
if (isSystem_)
return;
// Hazard analysis can't tell that the telemetry callbacks don't GC.
JS::AutoSuppressGCAnalysis nogc;
int id = addonId
? JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS
: JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT;
// Call back into Firefox's Telemetry reporter.
for (size_t i = 0; i < DeprecatedLanguageExtensionCount; i++) {
if (sawDeprecatedLanguageExtension[i])
runtime_->addTelemetry(JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, i);
runtime_->addTelemetry(id, i);
}
}
void
JSCompartment::addTelemetry(const char* filename, DeprecatedLanguageExtension e)
{
// Only report telemetry for web content, not add-ons or chrome JS.
if (addonId || isSystem_ || !filename || strncmp(filename, "http", 4) != 0)
// Only report telemetry for web content and add-ons, not chrome JS.
if (isSystem_ || (!addonId && (!filename || strncmp(filename, "http", 4) != 0)))
return;
sawDeprecatedLanguageExtension[e] = true;

Просмотреть файл

@ -126,6 +126,7 @@ enum {
JS_TELEMETRY_GC_MINOR_REASON_LONG,
JS_TELEMETRY_GC_MINOR_US,
JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT,
JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS,
JS_TELEMETRY_ADDON_EXCEPTIONS
};

Просмотреть файл

@ -3119,6 +3119,9 @@ AccumulateTelemetryCallback(int id, uint32_t sample, const char* key)
case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT:
Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, sample);
break;
case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS:
Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS, sample);
break;
case JS_TELEMETRY_ADDON_EXCEPTIONS:
Telemetry::Accumulate(Telemetry::JS_TELEMETRY_ADDON_EXCEPTIONS, nsDependentCString(key), sample);
break;

Просмотреть файл

@ -433,11 +433,19 @@
"description": "Geolocation on OS X is either MLS or CoreLocation"
},
"JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT": {
"alert_emails": ["jdemooij@mozilla.com"],
"expires_in_version": "never",
"kind": "enumerated",
"n_values": 10,
"description": "Use of SpiderMonkey's deprecated language extensions in web content: ForEach=0, DestructuringForIn=1, LegacyGenerator=2, ExpressionClosure=3, LetBlock=4, LetExpression=5, NoSuchMethod=6, FlagsArgument=7, RegExpSourceProp=8"
},
"JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS": {
"alert_emails": ["jdemooij@mozilla.com"],
"expires_in_version": "never",
"kind": "enumerated",
"n_values": 10,
"description": "Use of SpiderMonkey's deprecated language extensions in add-ons: ForEach=0, DestructuringForIn=1, LegacyGenerator=2, ExpressionClosure=3, LetBlock=4, LetExpression=5, NoSuchMethod=6, FlagsArgument=7, RegExpSourceProp=8"
},
"XUL_CACHE_DISABLED": {
"expires_in_version": "default",
"kind": "flag",