зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1263042 - When the crash reporter is disabled, avoid JavaScript strict warnings in Telemetry code during startup. r=gfritzsche
This commit is contained in:
Родитель
4b7a85789e
Коммит
6b407c6579
|
@ -224,9 +224,10 @@ function toLocalTimeISOString(date) {
|
|||
*/
|
||||
function annotateCrashReport(sessionId) {
|
||||
try {
|
||||
const cr = Cc["@mozilla.org/toolkit/crash-reporter;1"]
|
||||
.getService(Ci.nsICrashReporter);
|
||||
cr.setTelemetrySessionId(sessionId);
|
||||
const cr = Cc["@mozilla.org/toolkit/crash-reporter;1"];
|
||||
if (cr) {
|
||||
cr.getService(Ci.nsICrashReporter).setTelemetrySessionId(sessionId);
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore errors when crash reporting is disabled
|
||||
}
|
||||
|
|
|
@ -39,10 +39,11 @@ TelemetryStartup.prototype.observe = function(aSubject, aTopic, aData) {
|
|||
|
||||
function annotateEnvironment() {
|
||||
try {
|
||||
let cr = Cc["@mozilla.org/toolkit/crash-reporter;1"]
|
||||
.getService(Ci.nsICrashReporter);
|
||||
let env = JSON.stringify(TelemetryEnvironment.currentEnvironment);
|
||||
cr.annotateCrashReport("TelemetryEnvironment", env);
|
||||
let cr = Cc["@mozilla.org/toolkit/crash-reporter;1"];
|
||||
if (cr) {
|
||||
let env = JSON.stringify(TelemetryEnvironment.currentEnvironment);
|
||||
cr.getService(Ci.nsICrashReporter).annotateCrashReport("TelemetryEnvironment", env);
|
||||
}
|
||||
} catch (e) {
|
||||
// crash reporting not built or disabled? Ignore errors
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче