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 log_util = (function() { | 5 log_util = (function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Creates a new log dump. |events| is a list of all events, |polledData| is | 9 * Creates a new log dump. |events| is a list of all events, |polledData| is |
10 * an object containing the results of each poll, |tabData| is an object | 10 * an object containing the results of each poll, |tabData| is an object |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // Check for validity of each log entry, and then add the ones that pass. | 172 // Check for validity of each log entry, and then add the ones that pass. |
173 // Since the events are kept around, and we can't just hide a single view | 173 // Since the events are kept around, and we can't just hide a single view |
174 // on a bad event, we have more error checking for them than other data. | 174 // on a bad event, we have more error checking for them than other data. |
175 var validEvents = []; | 175 var validEvents = []; |
176 var numDeprecatedPassiveEvents = 0; | 176 var numDeprecatedPassiveEvents = 0; |
177 for (var eventIndex = 0; eventIndex < logDump.events.length; ++eventIndex) { | 177 for (var eventIndex = 0; eventIndex < logDump.events.length; ++eventIndex) { |
178 var event = logDump.events[eventIndex]; | 178 var event = logDump.events[eventIndex]; |
179 if (typeof event == 'object' && | 179 if (typeof event == 'object' && |
180 typeof event.source == 'object' && | 180 typeof event.source == 'object' && |
181 typeof event.time == 'string' && | 181 typeof event.time == 'string' && |
182 typeof LogEventTypeNames[event.type] == 'string' && | 182 typeof EventTypeNames[event.type] == 'string' && |
183 typeof LogSourceTypeNames[event.source.type] == 'string' && | 183 typeof EventSourceTypeNames[event.source.type] == 'string' && |
184 getKeyWithValue(LogEventPhase, event.phase) != '?') { | 184 getKeyWithValue(EventPhase, event.phase) != '?') { |
185 if (event.wasPassivelyCaptured) { | 185 if (event.wasPassivelyCaptured) { |
186 // NOTE: Up until Chrome 18, log dumps included "passively captured" | 186 // NOTE: Up until Chrome 18, log dumps included "passively captured" |
187 // events. These are no longer supported, so skip past them | 187 // events. These are no longer supported, so skip past them |
188 // to avoid confusing the rest of the code. | 188 // to avoid confusing the rest of the code. |
189 numDeprecatedPassiveEvents++; | 189 numDeprecatedPassiveEvents++; |
190 continue; | 190 continue; |
191 } | 191 } |
192 validEvents.push(event); | 192 validEvents.push(event); |
193 } | 193 } |
194 } | 194 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 return loadLogDump(parsedDump, fileName); | 293 return loadLogDump(parsedDump, fileName); |
294 } | 294 } |
295 | 295 |
296 // Exports. | 296 // Exports. |
297 return { | 297 return { |
298 createUpdatedLogDump: createUpdatedLogDump, | 298 createUpdatedLogDump: createUpdatedLogDump, |
299 createLogDumpAsync: createLogDumpAsync, | 299 createLogDumpAsync: createLogDumpAsync, |
300 loadLogFile: loadLogFile | 300 loadLogFile: loadLogFile |
301 }; | 301 }; |
302 })(); | 302 })(); |
OLD | NEW |