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

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

Issue 8372018: Fix two warnings surfaced by closure compiler. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 2 months 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
« no previous file with comments | « chrome/browser/resources/net_internals/hsts_view.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 logutil = (function() { 5 logutil = (function() {
6 /** 6 /**
7 * Creates a new log dump. |events| is a list of all events, |polledData| is 7 * Creates a new log dump. |events| is a list of all events, |polledData| is
8 * an object containing the results of each poll, |tabData| is an object 8 * an object containing the results of each poll, |tabData| is an object
9 * containing data for individual tabs, and |date| is the time the dump was 9 * containing data for individual tabs, and |date| is the time the dump was
10 * created, as a formatted string. 10 * created, as a formatted string.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 parsedDump = JSON.parse(logFileContents); 213 parsedDump = JSON.parse(logFileContents);
214 } catch (error) { 214 } catch (error) {
215 try { 215 try {
216 // We may have a --log-net-log=blah log dump. If so, remove the comma 216 // We may have a --log-net-log=blah log dump. If so, remove the comma
217 // after the final good entry, and add the necessary close brackets. 217 // after the final good entry, and add the necessary close brackets.
218 var end = Math.max(logFileContents.lastIndexOf(',\n'), 218 var end = Math.max(logFileContents.lastIndexOf(',\n'),
219 logFileContents.lastIndexOf(',\r')); 219 logFileContents.lastIndexOf(',\r'));
220 if (end != -1) 220 if (end != -1)
221 parsedDump = JSON.parse(logFileContents.substring(0, end) + ']}'); 221 parsedDump = JSON.parse(logFileContents.substring(0, end) + ']}');
222 } 222 }
223 catch (error) { 223 catch (error2) {
224 } 224 }
225 } 225 }
226 226
227 if (!parsedDump) 227 if (!parsedDump)
228 return 'Unable to parse log dump as JSON file.'; 228 return 'Unable to parse log dump as JSON file.';
229 return loadLogDump(parsedDump, fileName); 229 return loadLogDump(parsedDump, fileName);
230 } 230 }
231 231
232 // Exports. 232 // Exports.
233 return { 233 return {
234 createLogDumpAsync : createLogDumpAsync, 234 createLogDumpAsync : createLogDumpAsync,
235 loadLogFile : loadLogFile 235 loadLogFile : loadLogFile
236 }; 236 };
237 })(); 237 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/hsts_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698