Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Mar 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/common/helper.ts
Expand Up @@ -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;
Expand Down