[Cleanup][DataLoader] Avoid using ArrayBuffer for buffering
This CL changes the buffering of received bytes in the {FetchDataLoaderAsArrayBuffer} class. The original implementation copied received bytes into a pre-allocated ArrayBuffer. Later when fetching finishes, the content of that ArrayBuffer is copied to another ArrayBuffer of the correct size. When the initial ArrayBuffer was not big enough, its content was copied to a bigger ArrayBuffer. The new implementation stores the received bytes in a list of chunks. When fetching finishes, we just allocate a big enough ArrayBuffer and copy the received chunks into it. This change removes unnecessary copies when the initial buffer was not big enough. The actual reason for the change is a refactoring of WTF::ArrayBuffer, so we try to remove unconventional uses of ArrayBuffer::Create. R=yhirano@chromium.org Bug: v8:9380, chromium:1008840 Change-Id: Ic8da2dc1d171cd23b016823e04791328a0d4dbfb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1828819 Commit-Queue: Andreas Haas <ahaas@chromium.org> Reviewed-by:Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#701523}
Showing
Please register or sign in to comment