OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 /** | 128 /** |
129 * Does a dispatch of a log record. | 129 * Does a dispatch of a log record. |
130 * | 130 * |
131 * @param {Array.<string>} fields Log record. | 131 * @param {Array.<string>} fields Log record. |
132 * @private | 132 * @private |
133 */ | 133 */ |
134 LogReader.prototype.dispatchLogRow_ = function(fields) { | 134 LogReader.prototype.dispatchLogRow_ = function(fields) { |
135 // Obtain the dispatch. | 135 // Obtain the dispatch. |
136 var command = fields[0]; | 136 var command = fields[0]; |
137 if (!(command in this.dispatchTable_)) return; | 137 if (!(command in this.dispatchTable_)) return; |
138 | 138 |
139 var dispatch = this.dispatchTable_[command]; | 139 var dispatch = this.dispatchTable_[command]; |
140 | 140 |
141 if (dispatch === null || this.skipDispatch(dispatch)) { | 141 if (dispatch === null || this.skipDispatch(dispatch)) { |
142 return; | 142 return; |
143 } | 143 } |
144 | 144 |
145 // Parse fields. | 145 // Parse fields. |
146 var parsedFields = []; | 146 var parsedFields = []; |
147 for (var i = 0; i < dispatch.parsers.length; ++i) { | 147 for (var i = 0; i < dispatch.parsers.length; ++i) { |
148 var parser = dispatch.parsers[i]; | 148 var parser = dispatch.parsers[i]; |
(...skipping 26 matching lines...) Expand all Loading... |
175 continue; | 175 continue; |
176 } | 176 } |
177 try { | 177 try { |
178 var fields = this.csvParser_.parseLine(line); | 178 var fields = this.csvParser_.parseLine(line); |
179 this.dispatchLogRow_(fields); | 179 this.dispatchLogRow_(fields); |
180 } catch (e) { | 180 } catch (e) { |
181 this.printError('line ' + (this.lineNum_ + 1) + ': ' + (e.message || e)); | 181 this.printError('line ' + (this.lineNum_ + 1) + ': ' + (e.message || e)); |
182 } | 182 } |
183 } | 183 } |
184 }; | 184 }; |
OLD | NEW |