|
@@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
|
|
|
(typeof window !== 'undefined' ? window : this).PDFJS = {};
|
|
|
}
|
|
|
|
|
|
-PDFJS.version = '1.0.122';
|
|
|
-PDFJS.build = 'aab48a2';
|
|
|
+PDFJS.version = '1.0.125';
|
|
|
+PDFJS.build = '4224bae';
|
|
|
|
|
|
(function pdfjsWrapper() {
|
|
|
// Use strict in our context only - users might not want it
|
|
@@ -9009,7 +9009,8 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
|
|
this.requestsByChunk = {};
|
|
|
this.callbacksByRequest = {};
|
|
|
|
|
|
- this.loadedStream = new LegacyPromise();
|
|
|
+ this._loadedStreamCapability = createPromiseCapability();
|
|
|
+
|
|
|
if (args.initialData) {
|
|
|
this.setInitialData(args.initialData);
|
|
|
}
|
|
@@ -9020,7 +9021,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
|
|
setInitialData: function ChunkedStreamManager_setInitialData(data) {
|
|
|
this.stream.onReceiveInitialData(data);
|
|
|
if (this.stream.allChunksLoaded()) {
|
|
|
- this.loadedStream.resolve(this.stream);
|
|
|
+ this._loadedStreamCapability.resolve(this.stream);
|
|
|
} else if (this.msgHandler) {
|
|
|
this.msgHandler.send('DocProgress', {
|
|
|
loaded: data.length,
|
|
@@ -9030,7 +9031,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
|
|
},
|
|
|
|
|
|
onLoadedStream: function ChunkedStreamManager_getLoadedStream() {
|
|
|
- return this.loadedStream;
|
|
|
+ return this._loadedStreamCapability.promise;
|
|
|
},
|
|
|
|
|
|
// Get all the chunks that are not yet loaded and groups them into
|
|
@@ -9038,7 +9039,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
|
|
requestAllChunks: function ChunkedStreamManager_requestAllChunks() {
|
|
|
var missingChunks = this.stream.getMissingChunks();
|
|
|
this.requestChunks(missingChunks);
|
|
|
- return this.loadedStream;
|
|
|
+ return this._loadedStreamCapability.promise;
|
|
|
},
|
|
|
|
|
|
requestChunks: function ChunkedStreamManager_requestChunks(chunks,
|
|
@@ -9174,7 +9175,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
|
|
|
|
|
this.stream.onReceiveData(begin, chunk);
|
|
|
if (this.stream.allChunksLoaded()) {
|
|
|
- this.loadedStream.resolve(this.stream);
|
|
|
+ this._loadedStreamCapability.resolve(this.stream);
|
|
|
}
|
|
|
|
|
|
var loadedRequests = [];
|
|
@@ -9234,6 +9235,10 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ onError: function ChunkedStreamManager_onError(err) {
|
|
|
+ this._loadedStreamCapability.reject(err);
|
|
|
+ },
|
|
|
+
|
|
|
getBeginChunk: function ChunkedStreamManager_getBeginChunk(begin) {
|
|
|
var chunk = Math.floor(begin / this.chunkSize);
|
|
|
return chunk;
|