| Index: chrome/browser/resources/net_internals/log_util.js
|
| diff --git a/chrome/browser/resources/net_internals/log_util.js b/chrome/browser/resources/net_internals/log_util.js
|
| index 54a060713bef661dd1b98ce18ada038032ce3ef3..a8ebe769f6e4e9c7b1e77b718f4aafdb73a96fa0 100644
|
| --- a/chrome/browser/resources/net_internals/log_util.js
|
| +++ b/chrome/browser/resources/net_internals/log_util.js
|
| @@ -31,8 +31,9 @@ log_util = (function() {
|
| * |polledData| and |tabData| may be empty objects, or may be missing data for
|
| * tabs not present on the OS the log is from.
|
| */
|
| - function createLogDump(userComments, constants, events, polledData, tabData,
|
| - numericDate, privacyStripping) {
|
| + function createLogDump(
|
| + userComments, constants, events, polledData, tabData, numericDate,
|
| + privacyStripping) {
|
| if (privacyStripping)
|
| events = events.map(stripPrivacyInfo);
|
|
|
| @@ -64,13 +65,9 @@ log_util = (function() {
|
| numericDate = oldLogDump.constants.clientInfo.numericDate;
|
| }
|
| var logDump = createLogDump(
|
| - userComments,
|
| - Constants,
|
| + userComments, Constants,
|
| EventsTracker.getInstance().getAllCapturedEvents(),
|
| - oldLogDump.polledData,
|
| - getTabData_(),
|
| - numericDate,
|
| - privacyStripping);
|
| + oldLogDump.polledData, getTabData_(), numericDate, privacyStripping);
|
| return JSON.stringify(logDump);
|
| }
|
|
|
| @@ -78,16 +75,12 @@ log_util = (function() {
|
| * Creates a full log dump using |polledData| and the return value of each
|
| * tab's saveState function and passes it to |callback|.
|
| */
|
| - function onUpdateAllCompleted(userComments, callback, privacyStripping,
|
| - polledData) {
|
| + function onUpdateAllCompleted(
|
| + userComments, callback, privacyStripping, polledData) {
|
| var logDump = createLogDump(
|
| - userComments,
|
| - Constants,
|
| - EventsTracker.getInstance().getAllCapturedEvents(),
|
| - polledData,
|
| - getTabData_(),
|
| - timeutil.getCurrentTime(),
|
| - privacyStripping);
|
| + userComments, Constants,
|
| + EventsTracker.getInstance().getAllCapturedEvents(), polledData,
|
| + getTabData_(), timeutil.getCurrentTime(), privacyStripping);
|
| callback(JSON.stringify(logDump));
|
| }
|
|
|
| @@ -97,9 +90,8 @@ log_util = (function() {
|
| * text as a string.
|
| */
|
| function createLogDumpAsync(userComments, callback, privacyStripping) {
|
| - g_browser.updateAllInfo(
|
| - onUpdateAllCompleted.bind(null, userComments, callback,
|
| - privacyStripping));
|
| + g_browser.updateAllInfo(onUpdateAllCompleted.bind(
|
| + null, userComments, callback, privacyStripping));
|
| }
|
|
|
| /**
|
| @@ -163,8 +155,8 @@ log_util = (function() {
|
|
|
| if (logDump.constants.logFormatVersion != Constants.logFormatVersion) {
|
| return 'Unable to load different log version.' +
|
| - ' Found ' + logDump.constants.logFormatVersion +
|
| - ', Expected ' + Constants.logFormatVersion;
|
| + ' Found ' + logDump.constants.logFormatVersion + ', Expected ' +
|
| + Constants.logFormatVersion;
|
| }
|
|
|
| g_browser.receivedConstants(logDump.constants);
|
| @@ -176,8 +168,7 @@ log_util = (function() {
|
| var numDeprecatedPassiveEvents = 0;
|
| for (var eventIndex = 0; eventIndex < logDump.events.length; ++eventIndex) {
|
| var event = logDump.events[eventIndex];
|
| - if (typeof event == 'object' &&
|
| - typeof event.source == 'object' &&
|
| + if (typeof event == 'object' && typeof event.source == 'object' &&
|
| typeof event.time == 'string' &&
|
| typeof EventTypeNames[event.type] == 'string' &&
|
| typeof EventSourceTypeNames[event.source.type] == 'string' &&
|
| @@ -233,7 +224,7 @@ log_util = (function() {
|
| (validEvents.length + numDeprecatedPassiveEvents);
|
| if (numInvalidEvents > 0) {
|
| errorString += 'Unable to load ' + numInvalidEvents +
|
| - ' events, due to invalid data.\n\n';
|
| + ' events, due to invalid data.\n\n';
|
| }
|
|
|
| if (numDeprecatedPassiveEvents > 0) {
|
| @@ -250,14 +241,13 @@ log_util = (function() {
|
| // The try block eliminates the need for checking every single value
|
| // before trying to access it.
|
| try {
|
| - if (view.onLoadLogFinish(logDump.polledData,
|
| - logDump.tabData[tabId],
|
| - logDump)) {
|
| + if (view.onLoadLogFinish(
|
| + logDump.polledData, logDump.tabData[tabId], logDump)) {
|
| showView = true;
|
| }
|
| } catch (error) {
|
| - errorString += 'Caught error while calling onLoadLogFinish: ' +
|
| - error + '\n\n';
|
| + errorString +=
|
| + 'Caught error while calling onLoadLogFinish: ' + error + '\n\n';
|
| }
|
| tabSwitcher.showTabLink(tabId, showView);
|
| }
|
| @@ -282,14 +272,14 @@ log_util = (function() {
|
| try {
|
| // We may have a --log-net-log=blah log dump. If so, remove the comma
|
| // after the final good entry, and add the necessary close brackets.
|
| - var end = Math.max(logFileContents.lastIndexOf(',\n'),
|
| - logFileContents.lastIndexOf(',\r'));
|
| + var end = Math.max(
|
| + logFileContents.lastIndexOf(',\n'),
|
| + logFileContents.lastIndexOf(',\r'));
|
| if (end != -1) {
|
| parsedDump = JSON.parse(logFileContents.substring(0, end) + ']}');
|
| errorString += 'Log file truncated. Events may be missing.\n';
|
| }
|
| - }
|
| - catch (error2) {
|
| + } catch (error2) {
|
| }
|
| }
|
|
|
|
|