Merge pull request #9303 from Snuffleupagus/rm-pdfInfo-encrypted

[api-major] Remove the unused `encrypted` property from the `pdfInfo` object sent from the worker via the `GetDoc` message
This commit is contained in:
Tim van der Meij 2017-12-22 21:38:52 +01:00 committed by GitHub
commit 404cba878c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 16 deletions

View File

@ -402,19 +402,15 @@ var WorkerMessageHandler = {
var loadDocumentCapability = createPromiseCapability(); var loadDocumentCapability = createPromiseCapability();
var parseSuccess = function parseSuccess() { var parseSuccess = function parseSuccess() {
var numPagesPromise = pdfManager.ensureDoc('numPages'); Promise.all([
var fingerprintPromise = pdfManager.ensureDoc('fingerprint'); pdfManager.ensureDoc('numPages'),
var encryptedPromise = pdfManager.ensureXRef('encrypt'); pdfManager.ensureDoc('fingerprint'),
Promise.all([numPagesPromise, fingerprintPromise, ]).then(function([numPages, fingerprint]) {
encryptedPromise]).then(function onDocReady(results) { loadDocumentCapability.resolve({
var doc = { numPages,
numPages: results[0], fingerprint,
fingerprint: results[1], });
encrypted: !!results[2], }, parseFailure);
};
loadDocumentCapability.resolve(doc);
},
parseFailure);
}; };
var parseFailure = function parseFailure(e) { var parseFailure = function parseFailure(e) {

View File

@ -1649,9 +1649,8 @@ var WorkerTransport = (function WorkerTransportClosure() {
}; };
}, this); }, this);
messageHandler.on('GetDoc', function transportDoc(data) { messageHandler.on('GetDoc', function transportDoc({ pdfInfo, }) {
var pdfInfo = data.pdfInfo; this.numPages = pdfInfo.numPages;
this.numPages = data.pdfInfo.numPages;
var loadingTask = this.loadingTask; var loadingTask = this.loadingTask;
var pdfDocument = new PDFDocumentProxy(pdfInfo, this, loadingTask); var pdfDocument = new PDFDocumentProxy(pdfInfo, this, loadingTask);
this.pdfDocument = pdfDocument; this.pdfDocument = pdfDocument;