chore: revert #7868 to use the size parameter for streaming PDF (#8145)

Issues: #7757
This commit is contained in:
Alex Rudenko 2022-03-18 15:08:25 +01:00 committed by GitHub
parent 8d4067e634
commit 7748730163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -360,15 +360,12 @@ async function getReadableFromProtocolStream(
let eof = false;
return new Readable({
async read() {
// TODO: use the advised size parameter to read function once
// crbug.com/1290727 is resolved.
// Also, see https://github.com/puppeteer/puppeteer/pull/7868.
async read(size: number) {
if (eof) {
return null;
}
const response = await client.send('IO.read', { handle });
const response = await client.send('IO.read', { handle, size });
this.push(response.data, response.base64Encoded ? 'base64' : undefined);
if (response.eof) {
eof = true;