From 1e5a72bfe4a4bd53a7c95141643c682d1060fd43 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 22 Sep 2014 16:27:41 -0500 Subject: [PATCH] PDF.js version 1.0.391 --- bower.json | 2 +- build/pdf.combined.js | 19 ++++++++++++++++--- build/pdf.js | 4 ++-- build/pdf.worker.js | 19 ++++++++++++++++--- package.json | 2 +- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index 6b4ac35cd..9972bae45 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.389", + "version": "1.0.391", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index c61950fd7..49fdc9c80 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.389'; -PDFJS.build = 'bab40ca'; +PDFJS.version = '1.0.391'; +PDFJS.build = '011eb84'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -7204,6 +7204,7 @@ var ChunkedStream = (function ChunkedStreamClosure() { this.numChunks = Math.ceil(length / chunkSize); this.manager = manager; this.initialDataLength = 0; + this.lastSuccessfulEnsureByteChunk = -1; // a single-entry cache } // required methods for a stream. if a particular stream does not @@ -7263,6 +7264,18 @@ var ChunkedStream = (function ChunkedStreamClosure() { } }, + ensureByte: function ChunkedStream_ensureRange(pos) { + var chunk = Math.floor(pos / this.chunkSize); + if (chunk === this.lastSuccessfulEnsureByteChunk) { + return; + } + + if (!(chunk in this.loadedChunks)) { + throw new MissingDataException(pos, pos + 1); + } + this.lastSuccessfulEnsureByteChunk = chunk; + }, + ensureRange: function ChunkedStream_ensureRange(begin, end) { if (begin >= end) { return; @@ -7315,7 +7328,7 @@ var ChunkedStream = (function ChunkedStreamClosure() { if (pos >= this.end) { return -1; } - this.ensureRange(pos, pos + 1); + this.ensureByte(pos); return this.bytes[this.pos++]; }, diff --git a/build/pdf.js b/build/pdf.js index ede52f019..10d0032d4 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.389'; -PDFJS.build = 'bab40ca'; +PDFJS.version = '1.0.391'; +PDFJS.build = '011eb84'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 7f139a318..88025736b 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.389'; -PDFJS.build = 'bab40ca'; +PDFJS.version = '1.0.391'; +PDFJS.build = '011eb84'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -2603,6 +2603,7 @@ var ChunkedStream = (function ChunkedStreamClosure() { this.numChunks = Math.ceil(length / chunkSize); this.manager = manager; this.initialDataLength = 0; + this.lastSuccessfulEnsureByteChunk = -1; // a single-entry cache } // required methods for a stream. if a particular stream does not @@ -2662,6 +2663,18 @@ var ChunkedStream = (function ChunkedStreamClosure() { } }, + ensureByte: function ChunkedStream_ensureRange(pos) { + var chunk = Math.floor(pos / this.chunkSize); + if (chunk === this.lastSuccessfulEnsureByteChunk) { + return; + } + + if (!(chunk in this.loadedChunks)) { + throw new MissingDataException(pos, pos + 1); + } + this.lastSuccessfulEnsureByteChunk = chunk; + }, + ensureRange: function ChunkedStream_ensureRange(begin, end) { if (begin >= end) { return; @@ -2714,7 +2727,7 @@ var ChunkedStream = (function ChunkedStreamClosure() { if (pos >= this.end) { return -1; } - this.ensureRange(pos, pos + 1); + this.ensureByte(pos); return this.bytes[this.pos++]; }, diff --git a/package.json b/package.json index d381e61b4..671c60df0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.389", + "version": "1.0.391", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",