| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 /** | 5 /** |
| 6 * TODO(eroman): This needs better presentation, and cleaner code. This | 6 * TODO(eroman): This needs better presentation, and cleaner code. This |
| 7 * implementation is more of a transitionary step as | 7 * implementation is more of a transitionary step as |
| 8 * the old net-internals is replaced. | 8 * the old net-internals is replaced. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 addTextNode(nobr, sourceEntry.getDescription()); | 36 addTextNode(nobr, sourceEntry.getDescription()); |
| 37 | 37 |
| 38 var p2 = addNode(div, 'p'); | 38 var p2 = addNode(div, 'p'); |
| 39 var nobr2 = addNode(p2, 'nobr'); | 39 var nobr2 = addNode(p2, 'nobr'); |
| 40 | 40 |
| 41 var logEntries = sourceEntry.getLogEntries(); | 41 var logEntries = sourceEntry.getLogEntries(); |
| 42 var startDate = g_browser.convertTimeTicksToDate(logEntries[0].time); | 42 var startDate = g_browser.convertTimeTicksToDate(logEntries[0].time); |
| 43 addTextNode(nobr2, 'Start Time: ' + startDate.toLocaleString()); | 43 addTextNode(nobr2, 'Start Time: ' + startDate.toLocaleString()); |
| 44 | 44 |
| 45 var pre = addNode(div, 'pre'); | 45 var pre = addNode(div, 'pre'); |
| 46 addTextNode(pre, PrintSourceEntriesAsText(logEntries, false)); | 46 addTextNode(pre, PrintSourceEntriesAsText(logEntries)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 function canCollapseBeginWithEnd(beginEntry) { | 49 function canCollapseBeginWithEnd(beginEntry) { |
| 50 return beginEntry && | 50 return beginEntry && |
| 51 beginEntry.isBegin() && | 51 beginEntry.isBegin() && |
| 52 beginEntry.end && | 52 beginEntry.end && |
| 53 beginEntry.end.index == beginEntry.index + 1 && | 53 beginEntry.end.index == beginEntry.index + 1 && |
| 54 (!beginEntry.orig.params || !beginEntry.end.orig.params) && | 54 (!beginEntry.orig.params || !beginEntry.end.orig.params) && |
| 55 beginEntry.orig.wasPassivelyCaptured == | 55 beginEntry.orig.wasPassivelyCaptured == |
| 56 beginEntry.end.orig.wasPassivelyCaptured; | 56 beginEntry.end.orig.wasPassivelyCaptured; |
| 57 } | 57 } |
| 58 | 58 |
| 59 PrintSourceEntriesAsText = function(sourceEntries, doSecurityStripping) { | 59 PrintSourceEntriesAsText = function(sourceEntries) { |
| 60 var entries = LogGroupEntry.createArrayFrom(sourceEntries); | 60 var entries = LogGroupEntry.createArrayFrom(sourceEntries); |
| 61 if (entries.length == 0) | 61 if (entries.length == 0) |
| 62 return ''; | 62 return ''; |
| 63 | 63 |
| 64 var startDate = g_browser.convertTimeTicksToDate(entries[0].orig.time); | 64 var startDate = g_browser.convertTimeTicksToDate(entries[0].orig.time); |
| 65 var startTime = startDate.getTime(); | 65 var startTime = startDate.getTime(); |
| 66 | 66 |
| 67 var tablePrinter = new TablePrinter(); | 67 var tablePrinter = new TablePrinter(); |
| 68 | 68 |
| 69 for (var i = 0; i < entries.length; ++i) { | 69 for (var i = 0; i < entries.length; ++i) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 tablePrinter.addCell(']'); | 105 tablePrinter.addCell(']'); |
| 106 } else { | 106 } else { |
| 107 mainCell.allowOverflow = true; | 107 mainCell.allowOverflow = true; |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 // Output the extra parameters. | 111 // Output the extra parameters. |
| 112 if (entry.orig.params != undefined) { | 112 if (entry.orig.params != undefined) { |
| 113 // Add a continuation row for each line of text from the extra parameters. | 113 // Add a continuation row for each line of text from the extra parameters. |
| 114 var extraParamsText = getTextForExtraParams(entry.orig, | 114 var extraParamsText = getTextForExtraParams( |
| 115 doSecurityStripping); | 115 entry.orig, |
| 116 g_browser.getDoSecurityStripping()); |
| 116 var extraParamsTextLines = extraParamsText.split('\n'); | 117 var extraParamsTextLines = extraParamsText.split('\n'); |
| 117 | 118 |
| 118 for (var j = 0; j < extraParamsTextLines.length; ++j) { | 119 for (var j = 0; j < extraParamsTextLines.length; ++j) { |
| 119 tablePrinter.addRow(); | 120 tablePrinter.addRow(); |
| 120 tablePrinter.addCell(''); // Empty passive annotation. | 121 tablePrinter.addCell(''); // Empty passive annotation. |
| 121 tablePrinter.addCell(''); // No t=. | 122 tablePrinter.addCell(''); // No t=. |
| 122 tablePrinter.addCell(''); | 123 tablePrinter.addCell(''); |
| 123 tablePrinter.addCell(''); // No st=. | 124 tablePrinter.addCell(''); // No st=. |
| 124 tablePrinter.addCell(''); | 125 tablePrinter.addCell(''); |
| 125 tablePrinter.addCell(' '); | 126 tablePrinter.addCell(' '); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 var result = []; | 423 var result = []; |
| 423 for (var i = 0; i < modes.length; ++i) | 424 for (var i = 0; i < modes.length; ++i) |
| 424 result.push(indentLines('(' + (i + 1) + ') ', modes[i])); | 425 result.push(indentLines('(' + (i + 1) + ') ', modes[i])); |
| 425 | 426 |
| 426 return result.join('\n'); | 427 return result.join('\n'); |
| 427 }; | 428 }; |
| 428 | 429 |
| 429 // End of anonymous namespace. | 430 // End of anonymous namespace. |
| 430 })(); | 431 })(); |
| 431 | 432 |
| OLD | NEW |