mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 977708 - Annotate crash reports with the current experiment, r=felipe
This commit is contained in:
parent
7fa014103b
commit
beb8e7246c
@ -39,6 +39,11 @@ XPCOMUtils.defineLazyGetter(this, "CertUtils",
|
||||
return mod;
|
||||
});
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter",
|
||||
"@mozilla.org/xre/app-info;1",
|
||||
"nsICrashReporter");
|
||||
#endif
|
||||
|
||||
const FILE_CACHE = "experiments.json";
|
||||
const OBSERVER_TOPIC = "experiments-changed";
|
||||
@ -673,11 +678,6 @@ Experiments.Experiments.prototype = {
|
||||
return this._pendingTasks.loadFromCache;
|
||||
}
|
||||
|
||||
if (this._pendingTasks.updateManifest) {
|
||||
// We're already updating the manifest, no need to load the cached version.
|
||||
return this._pendingTasks.updateManifest;
|
||||
}
|
||||
|
||||
let path = this._cacheFilePath;
|
||||
this._pendingTasks.loadFromCache = Task.spawn(function () {
|
||||
try {
|
||||
@ -888,6 +888,7 @@ Experiments.Experiments.prototype = {
|
||||
yield activeExperiment.stop();
|
||||
yield activeExperiment.start();
|
||||
} catch (e) {
|
||||
gLogger.error(e);
|
||||
// On failure try the next experiment.
|
||||
activeExperiment = null;
|
||||
}
|
||||
@ -921,6 +922,7 @@ Experiments.Experiments.prototype = {
|
||||
try {
|
||||
yield experiment.start();
|
||||
activeChanged = true;
|
||||
activeExperiment = experiment;
|
||||
break;
|
||||
} catch (e) {
|
||||
// On failure try the next experiment.
|
||||
@ -933,6 +935,12 @@ Experiments.Experiments.prototype = {
|
||||
Services.obs.notifyObservers(null, OBSERVER_TOPIC, null);
|
||||
}
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
if (activeExperiment) {
|
||||
gCrashReporter.annotateCrashReport("ActiveExperiment", activeExperiment.id);
|
||||
}
|
||||
#endif
|
||||
|
||||
throw new Task.Result(activeChanged);
|
||||
}.bind(this));
|
||||
},
|
||||
|
@ -9,7 +9,7 @@ EXTRA_COMPONENTS += [
|
||||
|
||||
JS_MODULES_PATH = 'modules/experiments'
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
EXTRA_PP_JS_MODULES += [
|
||||
'Experiments.jsm',
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user