Skip to content

Commit

Permalink
Improve work-around for importScripts bug.
Browse files Browse the repository at this point in the history
Reverts "Hack to avoid intermidiate Chrome failures during tests."
(2b2c521).

Updates require.js to the latest version (pre-release), which includes
an alternative work-around for the bug that was worked around by the
reverted commit. The advantage of the new work-around is that it allows
the runtime to garbage-collect idle Workers.

References:
- https://crbug.com/572225
- https://webkit.org/b/153317
- requirejs/requirejs#1469
  • Loading branch information
Rob--W committed Jan 22, 2016
1 parent 58329f7 commit 47bb01f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"jsdoc": "^3.3.0-alpha9",
"jshint": "~2.8.0",
"node-ensure": "^0.0.0",
"requirejs": "^2.1.22",
"requirejs": "jrburke/requirejs#a1da39714bc3eea9ab85c77e47d544e815e2699f",
"rimraf": "^2.4.1",
"shelljs": "~0.4.0",
"typogr": "~0.6.5",
Expand Down
9 changes: 0 additions & 9 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1276,16 +1276,7 @@ var PDFWorker = (function PDFWorkerClosure() {
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
var worker = new Worker(workerSrc);
var messageHandler = new MessageHandler('main', 'worker', worker);
//#if !PRODUCTION
// Don't allow worker to be destroyed by Chrome, see:
// https://code.google.com/p/chromium/issues/detail?id=572225
var jsWorkerId = '_workerKungfuGrip_' + Math.random();
window[jsWorkerId] = worker;
//#endif
messageHandler.on('test', function PDFWorker_test(data) {
//#if !PRODUCTION
delete window[jsWorkerId];
//#endif
if (this.destroyed) {
this._readyCapability.reject(new Error('Worker was destroyed'));
messageHandler.destroy();
Expand Down

0 comments on commit 47bb01f

Please sign in to comment.