зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 6a68273665f6 (bug 1340842) for test failures in browser_bookmark_all_tabs.js
This commit is contained in:
Родитель
244eda4665
Коммит
e05881a009
|
@ -168,17 +168,11 @@ this.TelemetryStopwatch = {
|
|||
* @param (Object) aObj - Optional parameter which associates the histogram
|
||||
* timer with the given object.
|
||||
*
|
||||
* @param {Boolean} aCanceledOkay - Optional parameter which will suppress any
|
||||
* warnings that normally fire when a stopwatch
|
||||
* is finished after being cancelled. Defaults
|
||||
* to false.
|
||||
*
|
||||
* @returns {Integer} time in milliseconds or -1 if the stopwatch was not
|
||||
* found.
|
||||
*/
|
||||
timeElapsed(aHistogram, aObj, aCanceledOkay) {
|
||||
return TelemetryStopwatchImpl.timeElapsed(aHistogram, aObj, null,
|
||||
aCanceledOkay);
|
||||
timeElapsed(aHistogram, aObj) {
|
||||
return TelemetryStopwatchImpl.timeElapsed(aHistogram, aObj, null);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -191,16 +185,11 @@ this.TelemetryStopwatch = {
|
|||
* @param {Object} aObj - Optional parameter which associates the histogram
|
||||
* timer with the given object.
|
||||
*
|
||||
* @param {Boolean} aCanceledOkay - Optional parameter which will suppress any
|
||||
* warnings that normally fire when a stopwatch
|
||||
* is finished after being cancelled. Defaults
|
||||
* to false.
|
||||
*
|
||||
* @returns {Boolean} True if the timer was succesfully stopped and the data
|
||||
* was added to the histogram, False otherwise.
|
||||
*/
|
||||
finish(aHistogram, aObj, aCanceledOkay) {
|
||||
return TelemetryStopwatchImpl.finish(aHistogram, aObj, null, aCanceledOkay);
|
||||
finish(aHistogram, aObj) {
|
||||
return TelemetryStopwatchImpl.finish(aHistogram, aObj, null);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -262,9 +251,8 @@ this.TelemetryStopwatch = {
|
|||
* @return {Integer} time in milliseconds or -1 if the stopwatch was not
|
||||
* found.
|
||||
*/
|
||||
timeElapsedKeyed(aHistogram, aKey, aObj, aCanceledOkay) {
|
||||
return TelemetryStopwatchImpl.timeElapsed(aHistogram, aObj, aKey,
|
||||
aCanceledOkay);
|
||||
timeElapsedKeyed(aHistogram, aKey, aObj) {
|
||||
return TelemetryStopwatchImpl.timeElapsed(aHistogram, aObj, aKey);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -279,16 +267,11 @@ this.TelemetryStopwatch = {
|
|||
* @param {Object} aObj - optional parameter which associates the histogram
|
||||
* timer with the given object.
|
||||
*
|
||||
* @param {Boolean} aCanceledOkay - Optional parameter which will suppress any
|
||||
* warnings that normally fire when a stopwatch
|
||||
* is finished after being cancelled. Defaults
|
||||
* to false.
|
||||
*
|
||||
* @returns {Boolean} True if the timer was succesfully stopped and the data
|
||||
* was added to the histogram, False otherwise.
|
||||
*/
|
||||
finishKeyed(aHistogram, aKey, aObj, aCanceledOkay) {
|
||||
return TelemetryStopwatchImpl.finish(aHistogram, aObj, aKey, aCanceledOkay);
|
||||
finishKeyed(aHistogram, aKey, aObj) {
|
||||
return TelemetryStopwatchImpl.finish(aHistogram, aObj, aKey);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -308,14 +291,12 @@ this.TelemetryStopwatchImpl = {
|
|||
return Timers.delete(histogram, object, key);
|
||||
},
|
||||
|
||||
timeElapsed(histogram, object, key, aCanceledOkay) {
|
||||
timeElapsed(histogram, object, key) {
|
||||
let startTime = Timers.get(histogram, object, key);
|
||||
if (startTime === null) {
|
||||
if (!aCanceledOkay) {
|
||||
Cu.reportError("TelemetryStopwatch: requesting elapsed time for " +
|
||||
`nonexisting stopwatch. Histogram: "${histogram}", ` +
|
||||
`key: "${key}"`);
|
||||
}
|
||||
Cu.reportError("TelemetryStopwatch: requesting elapsed time for " +
|
||||
`nonexisting stopwatch. Histogram: "${histogram}", ` +
|
||||
`key: "${key}"`);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -330,8 +311,8 @@ this.TelemetryStopwatchImpl = {
|
|||
}
|
||||
},
|
||||
|
||||
finish(histogram, object, key, aCanceledOkay) {
|
||||
let delta = this.timeElapsed(histogram, object, key, aCanceledOkay);
|
||||
finish(histogram, object, key) {
|
||||
let delta = this.timeElapsed(histogram, object, key);
|
||||
if (delta == -1) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -44,19 +44,6 @@ Example:
|
|||
// ... do more work.
|
||||
TelemetryStopwatch.finish("SAMPLE_FILE_LOAD_TIME_MS");
|
||||
|
||||
// Periodically, it's necessary to attempt to finish a
|
||||
// TelemetryStopwatch that's already been canceled or
|
||||
// finished. Normally, that throws a warning to the
|
||||
// console. If the TelemetryStopwatch being possibly
|
||||
// cancelled or finished is expected behaviour, the
|
||||
// warning can be suppressed by passing the optional
|
||||
// aCanceledOkay argument.
|
||||
|
||||
// ... suppress warning on a previously finished
|
||||
// TelemetryStopwatch
|
||||
TelemetryStopwatch.finish("SAMPLE_FILE_LOAD_TIME_MS", null,
|
||||
true /* aCanceledOkay */);
|
||||
|
||||
From C++
|
||||
========
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче