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

Side by Side Diff: chrome/browser/resources/net_internals/source_entry.js

Issue 8474001: Add a timeline view to about:net-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Comment fix Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 isError: function() { 192 isError: function() {
193 return this.isError_; 193 return this.isError_;
194 }, 194 },
195 195
196 /** 196 /**
197 * Returns time of last event if inactive. Returns current time otherwise. 197 * Returns time of last event if inactive. Returns current time otherwise.
198 */ 198 */
199 getEndTime: function() { 199 getEndTime: function() {
200 if (!this.isInactive_) { 200 if (!this.isInactive_) {
201 return (new Date()).getTime(); 201 return timeutil.getCurrentTime();
202 } else { 202 } else {
203 var endTicks = this.entries_[this.entries_.length - 1].time; 203 var endTicks = this.entries_[this.entries_.length - 1].time;
204 return timeutil.convertTimeTicksToDate(endTicks).getTime(); 204 return timeutil.convertTimeTicksToDate(endTicks).getTime();
205 } 205 }
206 }, 206 },
207 207
208 /** 208 /**
209 * Returns the time between the first and last events with a matching 209 * Returns the time between the first and last events with a matching
210 * source ID. If source is still active, uses the current time for the 210 * source ID. If source is still active, uses the current time for the
211 * last event. 211 * last event.
212 */ 212 */
213 getDuration: function() { 213 getDuration: function() {
214 var startTicks = this.entries_[0].time; 214 var startTicks = this.entries_[0].time;
215 var startTime = timeutil.convertTimeTicksToDate(startTicks).getTime(); 215 var startTime = timeutil.convertTimeTicksToDate(startTicks).getTime();
216 var endTime = this.getEndTime(); 216 var endTime = this.getEndTime();
217 return endTime - startTime; 217 return endTime - startTime;
218 }, 218 },
219 219
220 printAsText: function() { 220 printAsText: function() {
221 return PrintSourceEntriesAsText(this.entries_); 221 return PrintSourceEntriesAsText(this.entries_);
222 } 222 }
223 }; 223 };
224 224
225 return SourceEntry; 225 return SourceEntry;
226 })(); 226 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/proxy_view.js ('k') | chrome/browser/resources/net_internals/source_tracker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698