From 12e1c91f73ac3fdab5da2bf432aedc1803755469 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 9 Sep 2019 17:35:24 +0200 Subject: [PATCH] Don't `enqueue` unused properties when sending 'GetOperatorList' data from the worker-thread (PR 11069 follow-up) With the changes made in PR 11069, it's no longer necessary to include the `pageIndex`/`intent` parameters when sending 'GetOperatorList' data. In the previous implementation these properties were used to associate the `OperatorList` with the correct `RenderTask`, however now that `ReadableStream`s are used that's handled automatically and it's thus dead code at this point. --- src/core/operator_list.js | 12 ++++-------- src/display/api.js | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/core/operator_list.js b/src/core/operator_list.js index bd08b765b..703a495d6 100644 --- a/src/core/operator_list.js +++ b/src/core/operator_list.js @@ -648,14 +648,10 @@ var OperatorList = (function OperatorListClosure() { this._totalLength += length; this._streamSink.enqueue({ - operatorList: { - fnArray: this.fnArray, - argsArray: this.argsArray, - lastChunk, - length, - }, - pageIndex: this.pageIndex, - intent: this.intent, + fnArray: this.fnArray, + argsArray: this.argsArray, + lastChunk, + length, }, 1, this._transfers); this.dependencies = Object.create(null); diff --git a/src/display/api.js b/src/display/api.js index 4cdbb18af..fe1d48373 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1324,7 +1324,7 @@ class PDFPageProxy { if (this._transport.destroyed) { return; // Ignore any pending requests if the worker was terminated. } - this._renderPageChunk(value.operatorList, intentState); + this._renderPageChunk(value, intentState); pump(); }, (reason) => { intentState.streamReader = null;