Chromium Code Reviews| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 for (var i = 0; i < this.entries_.length; ++i) { | 210 for (var i = 0; i < this.entries_.length; ++i) { |
| 211 if (this.entries_[i].type == type) { | 211 if (this.entries_[i].type == type) { |
| 212 return this.entries_[i]; | 212 return this.entries_[i]; |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 return undefined; | 215 return undefined; |
| 216 }, | 216 }, |
| 217 | 217 |
| 218 /** | 218 /** |
| 219 * Returns the last entry with the specified type, or undefined if not | 219 * Returns the last entry with the specified type, or undefined if not |
| 220 * found. | 220 * found. |
|
mmenke
2012/02/06 17:46:37
Fix comment. First PHASE_BEGIN or PHASE_NONE entr
ahendrickson
2012/02/06 23:03:45
Done.
| |
| 221 */ | 221 */ |
| 222 findLastLogEntryStartByType_: function(type) { | 222 findLastLogEntryStartByType_: function(type) { |
| 223 for (var i = this.entries_.length - 1; i >= 0; --i) { | 223 for (var i = this.entries_.length - 1; i >= 0; --i) { |
| 224 if (this.entries_[i].type == type) { | 224 if (this.entries_[i].type == type) { |
| 225 if (this.entries_[i].phase == LogEventPhase.PHASE_BEGIN) | 225 if (this.entries_[i].phase != LogEventPhase.PHASE_END) |
| 226 return this.entries_[i]; | 226 return this.entries_[i]; |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 return undefined; | 229 return undefined; |
| 230 }, | 230 }, |
| 231 | 231 |
| 232 getLogEntries: function() { | 232 getLogEntries: function() { |
| 233 return this.entries_; | 233 return this.entries_; |
| 234 }, | 234 }, |
| 235 | 235 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 289 * Prints descriptive text about |entries_| to a new node added to the end | 289 * Prints descriptive text about |entries_| to a new node added to the end |
| 290 * of |parent|. | 290 * of |parent|. |
| 291 */ | 291 */ |
| 292 printAsText: function(parent) { | 292 printAsText: function(parent) { |
| 293 printLogEntriesAsText(this.entries_, parent); | 293 printLogEntriesAsText(this.entries_, parent); |
| 294 } | 294 } |
| 295 }; | 295 }; |
| 296 | 296 |
| 297 return SourceEntry; | 297 return SourceEntry; |
| 298 })(); | 298 })(); |
| OLD | NEW |