[Pkg-javascript-commits] [pdf.js] 276/414: Pass the `PDFJS.postMessageTransfer` parameter to the worker, so that the `MessageHandler` can be setup correctly in `createDocumentHandler` (issue 6957)

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 91756f6e86bb780945e70c241c3de5e74e24a86e
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Wed Mar 16 18:34:26 2016 +0100

    Pass the `PDFJS.postMessageTransfer` parameter to the worker, so that the `MessageHandler` can be setup correctly in `createDocumentHandler` (issue 6957)
    
    This regressed in commit https://github.com/mozilla/pdf.js/pull/6571/commits/acdd49f48097ffcb27332673a8b51cd653f6de88, i.e. PR 6571.
    
    Fixes 6957.
---
 src/core/worker.js | 4 ++++
 src/display/api.js | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/core/worker.js b/src/core/worker.js
index f7fb7a2..ba6f0e0 100644
--- a/src/core/worker.js
+++ b/src/core/worker.js
@@ -480,6 +480,10 @@ var WorkerMessageHandler = PDFJS.WorkerMessageHandler = {
     var workerHandlerName = docParams.docId + '_worker';
     var handler = new MessageHandler(workerHandlerName, docId, port);
 
+    // Ensure that postMessage transfers are correctly enabled/disabled,
+    // to prevent "DataCloneError" in older versions of IE (see issue 6957).
+    handler.postMessageTransfers = docParams.postMessageTransfers;
+
     function ensureNotTerminated() {
       if (terminated) {
         throw new Error('Worker was terminated');
diff --git a/src/display/api.js b/src/display/api.js
index a9b2432..6aa3156 100644
--- a/src/display/api.js
+++ b/src/display/api.js
@@ -454,7 +454,8 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
     cMapPacked: PDFJS.cMapPacked,
     disableFontFace: PDFJS.disableFontFace,
     disableCreateObjectURL: PDFJS.disableCreateObjectURL,
-    verbosity: PDFJS.verbosity
+    verbosity: PDFJS.verbosity,
+    postMessageTransfers: PDFJS.postMessageTransfers,
   }).then(function (workerId) {
     if (worker.destroyed) {
       throw new Error('Worker was destroyed');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list