OLD | NEW |
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 SourceTracker = (function() { | 5 var SourceTracker = (function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * This class keeps track of all NetLog events. | 9 * This class keeps track of all NetLog events. |
10 * It receives events from the browser and when loading a log file, and passes | 10 * It receives events from the browser and when loading a log file, and passes |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 /** | 69 /** |
70 * Returns the number of events that were captured passively by the | 70 * Returns the number of events that were captured passively by the |
71 * browser prior to when the net-internals page was started. | 71 * browser prior to when the net-internals page was started. |
72 */ | 72 */ |
73 getNumPassivelyCapturedEvents: function() { | 73 getNumPassivelyCapturedEvents: function() { |
74 return this.numPassivelyCapturedEvents_; | 74 return this.numPassivelyCapturedEvents_; |
75 }, | 75 }, |
76 | 76 |
77 /** | 77 /** |
| 78 * Returns the description of the specified SourceEntry, or an empty string |
| 79 * if it doesn't exist. |
| 80 */ |
| 81 getDescription: function(id) { |
| 82 var entry = this.getSourceEntry(id); |
| 83 if (entry) |
| 84 return entry.getDescription(); |
| 85 return ''; |
| 86 }, |
| 87 |
| 88 /** |
78 * Returns the specified SourceEntry. | 89 * Returns the specified SourceEntry. |
79 */ | 90 */ |
80 getSourceEntry: function(id) { | 91 getSourceEntry: function(id) { |
81 return this.sourceEntries_[id]; | 92 return this.sourceEntries_[id]; |
82 }, | 93 }, |
83 | 94 |
84 onReceivedPassiveLogEntries: function(logEntries) { | 95 onReceivedPassiveLogEntries: function(logEntries) { |
85 // Due to an expected race condition, it is possible to receive actively | 96 // Due to an expected race condition, it is possible to receive actively |
86 // captured log entries before the passively logged entries are received. | 97 // captured log entries before the passively logged entries are received. |
87 // | 98 // |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 * ovserver.deleteAllSourceEntries() | 222 * ovserver.deleteAllSourceEntries() |
212 * observer.onSecurityStrippingChanged() | 223 * observer.onSecurityStrippingChanged() |
213 */ | 224 */ |
214 addObserver: function(observer) { | 225 addObserver: function(observer) { |
215 this.observers_.push(observer); | 226 this.observers_.push(observer); |
216 } | 227 } |
217 }; | 228 }; |
218 | 229 |
219 return SourceTracker; | 230 return SourceTracker; |
220 })(); | 231 })(); |
OLD | NEW |