Chromium Code Reviews| Index: Source/devtools/front_end/network/NetworkTimeCalculator.js |
| diff --git a/Source/devtools/front_end/network/NetworkTimeCalculator.js b/Source/devtools/front_end/network/NetworkTimeCalculator.js |
| index 08546afe1a1c1f4b4e2f2f324f6f8d06f4cc9e95..42c8b440571c57a1b22817a00dbb03f73afe6481 100644 |
| --- a/Source/devtools/front_end/network/NetworkTimeCalculator.js |
| +++ b/Source/devtools/front_end/network/NetworkTimeCalculator.js |
| @@ -309,22 +309,27 @@ WebInspector.NetworkTimeCalculator.prototype = { |
| */ |
| updateBoundaries: function(request) |
| { |
| - var lowerBound; |
| - if (this.startAtZero) |
| - lowerBound = 0; |
| - else |
| - lowerBound = this._lowerBound(request); |
| - |
| - if (lowerBound !== -1 && (typeof this._minimumBoundary === "undefined" || lowerBound < this._minimumBoundary)) { |
| - this._minimumBoundary = lowerBound; |
| - this._boundaryChanged(); |
| - } |
| - |
| + var lowerBound = this._lowerBound(request); |
| var upperBound = this._upperBound(request); |
| - if (upperBound !== -1 && (typeof this._maximumBoundary === "undefined" || upperBound > this._maximumBoundary)) { |
| - this._maximumBoundary = upperBound; |
| - this._boundaryChanged(); |
| + if (lowerBound !== -1 || this.startAtZero) |
| + this._updateBoundariesWithTimestamp(this.startAtZero ? 0 : lowerBound); |
| + if (upperBound !== -1) |
| + this._updateBoundariesWithTimestamp(upperBound); |
| + }, |
| + |
| + /** |
| + * @param {number} timestamp |
| + */ |
| + _updateBoundariesWithTimestamp: function(timestamp) |
|
yurys
2015/06/11 15:33:36
_extendBoundariesToIncludeTimestamp
alph
2015/06/11 16:35:00
Done.
|
| + { |
| + if (typeof this._minimumBoundary === "undefined" || typeof this._maximumBoundary === "undefined") { |
| + this._minimumBoundary = timestamp; |
| + this._maximumBoundary = timestamp + 1; |
| + } else { |
| + this._minimumBoundary = Math.min(timestamp, this._minimumBoundary); |
| + this._maximumBoundary = Math.max(timestamp, this._minimumBoundary + 1, this._maximumBoundary); |
| } |
| + this._boundaryChanged(); |
|
yurys
2015/06/11 15:33:36
This call can be done once in updateBoundaries.
alph
2015/06/11 16:35:00
Done.
|
| }, |
| /** |