OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var SourceEntry = (function() { | 5 var SourceEntry = (function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * A SourceEntry gathers all log entries with the same source. | 9 * A SourceEntry gathers all log entries with the same source. |
10 * | 10 * |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 }, | 281 }, |
282 | 282 |
283 /** | 283 /** |
284 * Returns time of last event if inactive. Returns current time otherwise. | 284 * Returns time of last event if inactive. Returns current time otherwise. |
285 */ | 285 */ |
286 getEndTime: function() { | 286 getEndTime: function() { |
287 if (!this.isInactive_) { | 287 if (!this.isInactive_) { |
288 return timeutil.getCurrentTime(); | 288 return timeutil.getCurrentTime(); |
289 } else { | 289 } else { |
290 var endTicks = this.entries_[this.entries_.length - 1].time; | 290 var endTicks = this.entries_[this.entries_.length - 1].time; |
291 return timeutil.convertTimeTicksToDate(endTicks).getTime(); | 291 return timeutil.convertTimeTicksToTime(endTicks); |
292 } | 292 } |
293 }, | 293 }, |
294 | 294 |
295 /** | 295 /** |
296 * Returns the time between the first and last events with a matching | 296 * Returns the time between the first and last events with a matching |
297 * source ID. If source is still active, uses the current time for the | 297 * source ID. If source is still active, uses the current time for the |
298 * last event. | 298 * last event. |
299 */ | 299 */ |
300 getDuration: function() { | 300 getDuration: function() { |
301 var startTicks = this.entries_[0].time; | 301 var startTicks = this.entries_[0].time; |
302 var startTime = timeutil.convertTimeTicksToDate(startTicks).getTime(); | 302 var startTime = timeutil.convertTimeTicksToTime(startTicks); |
303 var endTime = this.getEndTime(); | 303 var endTime = this.getEndTime(); |
304 return endTime - startTime; | 304 return endTime - startTime; |
305 }, | 305 }, |
306 | 306 |
307 /** | 307 /** |
308 * Prints descriptive text about |entries_| to a new node added to the end | 308 * Prints descriptive text about |entries_| to a new node added to the end |
309 * of |parent|. | 309 * of |parent|. |
310 */ | 310 */ |
311 printAsText: function(parent) { | 311 printAsText: function(parent) { |
| 312 // The date will be undefined if not viewing a loaded log file. |
312 printLogEntriesAsText(this.entries_, parent, | 313 printLogEntriesAsText(this.entries_, parent, |
313 SourceTracker.getInstance().getSecurityStripping()); | 314 SourceTracker.getInstance().getSecurityStripping(), |
| 315 Constants.clientInfo.numericDate); |
314 } | 316 } |
315 }; | 317 }; |
316 | 318 |
317 return SourceEntry; | 319 return SourceEntry; |
318 })(); | 320 })(); |
OLD | NEW |