Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1996)

Unified Diff: Source/devtools/front_end/timeline/TracingModel.js

Issue 318093002: Convert timestamp to milliseconds when creating TracingModel.Event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/timeline/TracingModel.js
diff --git a/Source/devtools/front_end/timeline/TracingModel.js b/Source/devtools/front_end/timeline/TracingModel.js
index 05a45036f538e4f305d34eee3235e55076591355..9dd7a0ec899249d8788659fee97459b25fc39efb 100644
--- a/Source/devtools/front_end/timeline/TracingModel.js
+++ b/Source/devtools/front_end/timeline/TracingModel.js
@@ -187,7 +187,7 @@ WebInspector.TracingModel.prototype = {
return;
}
if (payload.ph !== WebInspector.TracingModel.Phase.Metadata) {
- var timestamp = payload.ts;
+ var timestamp = payload.ts / 1000;
// We do allow records for unrelated threads to arrive out-of-order,
// so there's a chance we're getting records from the past.
if (timestamp && (!this._minimumRecordTime || timestamp < this._minimumRecordTime))
@@ -254,7 +254,7 @@ WebInspector.TracingModel.Event = function(payload, level, thread)
{
this.name = payload.name;
this.category = payload.cat;
- this.startTime = payload.ts;
+ this.startTime = payload.ts / 1000;
this.args = payload.args;
this.phase = payload.ph;
this.level = level;
@@ -307,7 +307,7 @@ WebInspector.TracingModel.Event.prototype = {
this.args[name] = payload.args[name];
}
}
- var duration = payload.ts - this.startTime;
+ var duration = payload.ts / 1000 - this.startTime;
if (duration < 0) {
console.assert(false, "Event out of order: " + this.name);
return;
@@ -483,7 +483,7 @@ WebInspector.TracingModel.Thread.prototype = {
var event = new WebInspector.TracingModel.Event(payload, this._stack.length, this);
if (payload.ph === WebInspector.TracingModel.Phase.Begin || payload.ph === WebInspector.TracingModel.Phase.Complete) {
if (payload.ph === WebInspector.TracingModel.Phase.Complete)
- event._setDuration(payload.dur);
+ event._setDuration(payload.dur / 1000);
this._stack.push(event);
if (this._maxStackDepth < this._stack.length)
this._maxStackDepth = this._stack.length;

Powered by Google App Engine
This is Rietveld 408576698