@@ -32,7 +32,6 @@ import { RequestHandler, RequestInfo } from './requestinfo';
32
32
import { isJustDef } from './type' ;
33
33
import { makeQueryString } from './url' ;
34
34
import { Headers , Connection , ErrorCode } from './connection' ;
35
- import { ConnectionPool } from './connectionPool' ;
36
35
37
36
export interface Request < T > {
38
37
getPromise ( ) : Promise < T > ;
@@ -68,7 +67,7 @@ class NetworkRequest<T> implements Request<T> {
68
67
private errorCallback_ : RequestHandler < StorageError , StorageError > | null ,
69
68
private timeout_ : number ,
70
69
private progressCallback_ : ( ( p1 : number , p2 : number ) => void ) | null ,
71
- private pool_ : ConnectionPool
70
+ private connectionFactory_ : ( ) => Connection
72
71
) {
73
72
this . promise_ = new Promise ( ( resolve , reject ) => {
74
73
this . resolve_ = resolve as ( value ?: T | PromiseLike < T > ) => void ;
@@ -89,7 +88,7 @@ class NetworkRequest<T> implements Request<T> {
89
88
backoffCallback ( false , new RequestEndStatus ( false , null , true ) ) ;
90
89
return ;
91
90
}
92
- const connection = this . pool_ . createConnection ( ) ;
91
+ const connection = this . connectionFactory_ ( ) ;
93
92
this . pendingConnection_ = connection ;
94
93
95
94
const progressListener : ( progressEvent : ProgressEvent ) => void =
@@ -272,7 +271,7 @@ export function makeRequest<T>(
272
271
appId : string | null ,
273
272
authToken : string | null ,
274
273
appCheckToken : string | null ,
275
- pool : ConnectionPool ,
274
+ requestFactory : ( ) => Connection ,
276
275
firebaseVersion ?: string
277
276
) : Request < T > {
278
277
const queryPart = makeQueryString ( requestInfo . urlParams ) ;
@@ -293,6 +292,6 @@ export function makeRequest<T>(
293
292
requestInfo . errorHandler ,
294
293
requestInfo . timeout ,
295
294
requestInfo . progressCallback ,
296
- pool
295
+ requestFactory
297
296
) ;
298
297
}
0 commit comments