@@ -233,18 +233,14 @@ class BrowserFileLoader {
233233 JetStream . updateCounterUI ( ) ;
234234 }
235235
236- async prefetchResourceFile ( file ) {
237- return await this . _prefetchResource ( file ) ;
238- }
239-
240236 async prefetchResourcePreload ( name , resource ) {
241- const blobData = await this . _prefetchResource ( resource ) ;
237+ const blobData = await this . prefetchResourceFile ( resource ) ;
242238 if ( ! globalThis . allIsGood )
243239 return ;
244240 return { name : name , resource : resource , blobURLOrPath : blobData . blobURL } ;
245241 }
246242
247- async _prefetchResource ( resource ) {
243+ async prefetchResourceFile ( resource ) {
248244 this . counter . totalResources ++ ;
249245 let blobDataOrPromise = this . _blobDataCache [ resource ] ;
250246 if ( ! blobDataOrPromise ) {
@@ -259,10 +255,11 @@ class BrowserFileLoader {
259255 this . _blobDataCache [ resource ] = blobDataOrPromise ;
260256 }
261257 const blobData = await blobDataOrPromise ;
262- // Replace the potential promise in the cache.
263- this . _blobDataCache [ resource ] = blobData ;
264258 if ( globalThis . allIsGood )
265259 this . _updateCounter ( ) ;
260+ // Replace the potential promise in the cache.
261+ this . _blobDataCache [ resource ] = blobData ;
262+ blobData . refCount ++ ;
266263 return blobData ;
267264 }
268265
@@ -323,6 +320,7 @@ class BrowserFileLoader {
323320 blobData . refCount -- ;
324321 if ( ! blobData . refCount ) {
325322 this . _blobDataCache [ file ] = undefined ;
323+ console . log ( "DELETING" , file ) ;
326324 }
327325 }
328326 }
@@ -336,7 +334,6 @@ class Driver {
336334 this . isReady = false ;
337335 this . isDone = false ;
338336 this . errors = [ ] ;
339- this . fileLoader = isInBrowser ? browserFileLoader : shellFileLoader ;
340337 // Make benchmark list unique and sort it.
341338 this . benchmarks = Array . from ( new Set ( benchmarks ) ) ;
342339 this . benchmarks . sort ( ( a , b ) => a . plan . name . toLowerCase ( ) < b . plan . name . toLowerCase ( ) ? 1 : - 1 ) ;
0 commit comments