Merge pull request #10958 from Snuffleupagus/api-rm-receivingOperatorList
Remove the `intentState.receivingOperatorList` boolean since it's redundant
This commit is contained in:
commit
28326165ff
@ -1023,7 +1023,6 @@ class PDFPageProxy {
|
|||||||
// If there's no displayReadyCapability yet, then the operatorList
|
// If there's no displayReadyCapability yet, then the operatorList
|
||||||
// was never requested before. Make the request and create the promise.
|
// was never requested before. Make the request and create the promise.
|
||||||
if (!intentState.displayReadyCapability) {
|
if (!intentState.displayReadyCapability) {
|
||||||
intentState.receivingOperatorList = true;
|
|
||||||
intentState.displayReadyCapability = createPromiseCapability();
|
intentState.displayReadyCapability = createPromiseCapability();
|
||||||
intentState.operatorList = {
|
intentState.operatorList = {
|
||||||
fnArray: [],
|
fnArray: [],
|
||||||
@ -1125,7 +1124,6 @@ class PDFPageProxy {
|
|||||||
if (!intentState.opListReadCapability) {
|
if (!intentState.opListReadCapability) {
|
||||||
opListTask = {};
|
opListTask = {};
|
||||||
opListTask.operatorListChanged = operatorListChanged;
|
opListTask.operatorListChanged = operatorListChanged;
|
||||||
intentState.receivingOperatorList = true;
|
|
||||||
intentState.opListReadCapability = createPromiseCapability();
|
intentState.opListReadCapability = createPromiseCapability();
|
||||||
intentState.renderTasks = [];
|
intentState.renderTasks = [];
|
||||||
intentState.renderTasks.push(opListTask);
|
intentState.renderTasks.push(opListTask);
|
||||||
@ -1241,7 +1239,7 @@ class PDFPageProxy {
|
|||||||
Object.keys(this.intentStates).some(function(intent) {
|
Object.keys(this.intentStates).some(function(intent) {
|
||||||
const intentState = this.intentStates[intent];
|
const intentState = this.intentStates[intent];
|
||||||
return (intentState.renderTasks.length !== 0 ||
|
return (intentState.renderTasks.length !== 0 ||
|
||||||
intentState.receivingOperatorList);
|
!intentState.operatorList.lastChunk);
|
||||||
}, this)) {
|
}, this)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1290,7 +1288,6 @@ class PDFPageProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (operatorListChunk.lastChunk) {
|
if (operatorListChunk.lastChunk) {
|
||||||
intentState.receivingOperatorList = false;
|
|
||||||
this._tryCleanup();
|
this._tryCleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2092,19 +2089,21 @@ class WorkerTransport {
|
|||||||
const page = this.pageCache[data.pageIndex];
|
const page = this.pageCache[data.pageIndex];
|
||||||
const intentState = page.intentStates[data.intent];
|
const intentState = page.intentStates[data.intent];
|
||||||
|
|
||||||
|
if (intentState.operatorList) {
|
||||||
|
// Mark operator list as complete.
|
||||||
|
intentState.operatorList.lastChunk = true;
|
||||||
|
|
||||||
|
for (let i = 0; i < intentState.renderTasks.length; i++) {
|
||||||
|
intentState.renderTasks[i].operatorListChanged();
|
||||||
|
}
|
||||||
|
page._tryCleanup();
|
||||||
|
}
|
||||||
|
|
||||||
if (intentState.displayReadyCapability) {
|
if (intentState.displayReadyCapability) {
|
||||||
intentState.displayReadyCapability.reject(new Error(data.error));
|
intentState.displayReadyCapability.reject(new Error(data.error));
|
||||||
} else {
|
} else {
|
||||||
throw new Error(data.error);
|
throw new Error(data.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intentState.operatorList) {
|
|
||||||
// Mark operator list as complete.
|
|
||||||
intentState.operatorList.lastChunk = true;
|
|
||||||
for (let i = 0; i < intentState.renderTasks.length; i++) {
|
|
||||||
intentState.renderTasks[i].operatorListChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
messageHandler.on('UnsupportedFeature', this._onUnsupportedFeature, this);
|
messageHandler.on('UnsupportedFeature', this._onUnsupportedFeature, this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user