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

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

Issue 12226132: Reduce size of NetLog JSON dumps by not pretty-printing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « no previous file | 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) 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 numericDate = oldLogDump.constants.clientInfo.numericDate; 64 numericDate = oldLogDump.constants.clientInfo.numericDate;
65 } 65 }
66 var logDump = createLogDump( 66 var logDump = createLogDump(
67 userComments, 67 userComments,
68 Constants, 68 Constants,
69 EventsTracker.getInstance().getAllCapturedEvents(), 69 EventsTracker.getInstance().getAllCapturedEvents(),
70 oldLogDump.polledData, 70 oldLogDump.polledData,
71 getTabData_(), 71 getTabData_(),
72 numericDate, 72 numericDate,
73 privacyStripping); 73 privacyStripping);
74 return JSON.stringify(logDump, null, ' '); 74 return JSON.stringify(logDump);
75 } 75 }
76 76
77 /** 77 /**
78 * Creates a full log dump using |polledData| and the return value of each 78 * Creates a full log dump using |polledData| and the return value of each
79 * tab's saveState function and passes it to |callback|. 79 * tab's saveState function and passes it to |callback|.
80 */ 80 */
81 function onUpdateAllCompleted(userComments, callback, privacyStripping, 81 function onUpdateAllCompleted(userComments, callback, privacyStripping,
82 polledData) { 82 polledData) {
83 var logDump = createLogDump( 83 var logDump = createLogDump(
84 userComments, 84 userComments,
85 Constants, 85 Constants,
86 EventsTracker.getInstance().getAllCapturedEvents(), 86 EventsTracker.getInstance().getAllCapturedEvents(),
87 polledData, 87 polledData,
88 getTabData_(), 88 getTabData_(),
89 timeutil.getCurrentTime(), 89 timeutil.getCurrentTime(),
90 privacyStripping); 90 privacyStripping);
91 callback(JSON.stringify(logDump, null, ' ')); 91 callback(JSON.stringify(logDump));
92 } 92 }
93 93
94 /** 94 /**
95 * Called to create a new log dump. Must not be called once a dump has been 95 * Called to create a new log dump. Must not be called once a dump has been
96 * loaded. Once a log dump has been created, |callback| is passed the dumped 96 * loaded. Once a log dump has been created, |callback| is passed the dumped
97 * text as a string. 97 * text as a string.
98 */ 98 */
99 function createLogDumpAsync(userComments, callback, privacyStripping) { 99 function createLogDumpAsync(userComments, callback, privacyStripping) {
100 g_browser.updateAllInfo( 100 g_browser.updateAllInfo(
101 onUpdateAllCompleted.bind(null, userComments, callback, 101 onUpdateAllCompleted.bind(null, userComments, callback,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698