| 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) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
| 4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 */ | 33 */ |
| 34 WebInspector.HARWriter = function() | 34 WebInspector.HARWriter = function() |
| 35 { | 35 { |
| 36 } | 36 }; |
| 37 | 37 |
| 38 WebInspector.HARWriter.prototype = { | 38 WebInspector.HARWriter.prototype = { |
| 39 /** | 39 /** |
| 40 * @param {!WebInspector.OutputStream} stream | 40 * @param {!WebInspector.OutputStream} stream |
| 41 * @param {!Array.<!WebInspector.NetworkRequest>} requests | 41 * @param {!Array.<!WebInspector.NetworkRequest>} requests |
| 42 * @param {!WebInspector.Progress} progress | 42 * @param {!WebInspector.Progress} progress |
| 43 */ | 43 */ |
| 44 write: function(stream, requests, progress) | 44 write: function(stream, requests, progress) |
| 45 { | 45 { |
| 46 this._stream = stream; | 46 this._stream = stream; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 stream.close(); | 113 stream.close(); |
| 114 this._writeProgress.done(); | 114 this._writeProgress.done(); |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 const chunkSize = 100000; | 117 const chunkSize = 100000; |
| 118 var text = this._text.substring(this._bytesWritten, this._bytesWritten +
chunkSize); | 118 var text = this._text.substring(this._bytesWritten, this._bytesWritten +
chunkSize); |
| 119 this._bytesWritten += text.length; | 119 this._bytesWritten += text.length; |
| 120 stream.write(text, this._writeNextChunk.bind(this)); | 120 stream.write(text, this._writeNextChunk.bind(this)); |
| 121 this._writeProgress.setWorked(this._bytesWritten); | 121 this._writeProgress.setWorked(this._bytesWritten); |
| 122 } | 122 } |
| 123 } | 123 }; |
| OLD | NEW |