| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 * @param {!Common.OutputStream} stream | 657 * @param {!Common.OutputStream} stream |
| 658 * @param {string=} error | 658 * @param {string=} error |
| 659 * @this {Console.ConsoleView} | 659 * @this {Console.ConsoleView} |
| 660 */ | 660 */ |
| 661 function writeNextChunk(stream, error) { | 661 function writeNextChunk(stream, error) { |
| 662 if (messageIndex >= this.itemCount() || error) { | 662 if (messageIndex >= this.itemCount() || error) { |
| 663 stream.close(); | 663 stream.close(); |
| 664 progressIndicator.done(); | 664 progressIndicator.done(); |
| 665 return; | 665 return; |
| 666 } | 666 } |
| 667 var lines = []; | 667 var messageContents = []; |
| 668 for (var i = 0; i < chunkSize && i + messageIndex < this.itemCount(); ++i)
{ | 668 for (var i = 0; i < chunkSize && i + messageIndex < this.itemCount(); ++i)
{ |
| 669 var message = this.itemElement(messageIndex + i); | 669 var message = this.itemElement(messageIndex + i); |
| 670 var messageContent = message.contentElement().deepTextContent(); | 670 messageContents.push(message.toExportString()); |
| 671 for (var j = 0; j < message.repeatCount(); ++j) | |
| 672 lines.push(messageContent); | |
| 673 } | 671 } |
| 674 messageIndex += i; | 672 messageIndex += i; |
| 675 stream.write(lines.join('\n') + '\n', writeNextChunk.bind(this)); | 673 stream.write(messageContents.join('\n') + '\n', writeNextChunk.bind(this))
; |
| 676 progressIndicator.setWorked(messageIndex); | 674 progressIndicator.setWorked(messageIndex); |
| 677 } | 675 } |
| 678 } | 676 } |
| 679 | 677 |
| 680 /** | 678 /** |
| 681 * @param {!Console.ConsoleViewMessage} lastMessage | 679 * @param {!Console.ConsoleViewMessage} lastMessage |
| 682 * @param {?Console.ConsoleViewMessage=} viewMessage | 680 * @param {?Console.ConsoleViewMessage=} viewMessage |
| 683 * @return {boolean} | 681 * @return {boolean} |
| 684 */ | 682 */ |
| 685 _tryToCollapseMessages(lastMessage, viewMessage) { | 683 _tryToCollapseMessages(lastMessage, viewMessage) { |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 return true; | 1334 return true; |
| 1337 } | 1335 } |
| 1338 return false; | 1336 return false; |
| 1339 } | 1337 } |
| 1340 }; | 1338 }; |
| 1341 | 1339 |
| 1342 /** | 1340 /** |
| 1343 * @typedef {{messageIndex: number, matchIndex: number}} | 1341 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1344 */ | 1342 */ |
| 1345 Console.ConsoleView.RegexMatchRange; | 1343 Console.ConsoleView.RegexMatchRange; |
| OLD | NEW |