@@ -52,21 +52,6 @@ class NetworkManager {
52
52
this . pendingRequests = Object . create ( null ) ;
53
53
}
54
54
55
- requestRange ( begin , end , listeners ) {
56
- const args = {
57
- begin,
58
- end,
59
- } ;
60
- for ( const prop in listeners ) {
61
- args [ prop ] = listeners [ prop ] ;
62
- }
63
- return this . request ( args ) ;
64
- }
65
-
66
- requestFull ( listeners ) {
67
- return this . request ( listeners ) ;
68
- }
69
-
70
55
request ( args ) {
71
56
const xhr = new XMLHttpRequest ( ) ;
72
57
const xhrId = this . currXhrId ++ ;
@@ -248,14 +233,13 @@ class PDFNetworkStreamFullRequestReader {
248
233
constructor ( manager , source ) {
249
234
this . _manager = manager ;
250
235
251
- const args = {
236
+ this . _url = source . url ;
237
+ this . _fullRequestId = manager . request ( {
252
238
onHeadersReceived : this . _onHeadersReceived . bind ( this ) ,
253
239
onDone : this . _onDone . bind ( this ) ,
254
240
onError : this . _onError . bind ( this ) ,
255
241
onProgress : this . _onProgress . bind ( this ) ,
256
- } ;
257
- this . _url = source . url ;
258
- this . _fullRequestId = manager . requestFull ( args ) ;
242
+ } ) ;
259
243
this . _headersCapability = Promise . withResolvers ( ) ;
260
244
this . _disableRange = source . disableRange || false ;
261
245
this . _contentLength = source . length ; // Optional
@@ -418,14 +402,15 @@ class PDFNetworkStreamRangeRequestReader {
418
402
constructor ( manager , begin , end ) {
419
403
this . _manager = manager ;
420
404
421
- const args = {
405
+ this . _url = manager . url ;
406
+ this . _requestId = manager . request ( {
407
+ begin,
408
+ end,
422
409
onHeadersReceived : this . _onHeadersReceived . bind ( this ) ,
423
410
onDone : this . _onDone . bind ( this ) ,
424
411
onError : this . _onError . bind ( this ) ,
425
412
onProgress : this . _onProgress . bind ( this ) ,
426
- } ;
427
- this . _url = manager . url ;
428
- this . _requestId = manager . requestRange ( begin , end , args ) ;
413
+ } ) ;
429
414
this . _requests = [ ] ;
430
415
this . _queuedChunk = null ;
431
416
this . _done = false ;
0 commit comments