/** * Requests a load of the code for the specified split point. If the load * fails, <code>loadErrorHandler</code> will be invoked. If it succeeds, then * the code will be installed, and the code is expected to invoke its own * on-success hooks, including a call to either * {@link #leftoversFragmentHasLoaded()} or {@link #fragmentHasLoaded(int)}. * * @param splitPoint the split point whose code needs to be loaded */ void inject(int splitPoint, LoadTerminatedHandler loadErrorHandler) { pendingDownloadErrorHandlers[splitPoint] = loadErrorHandler; if (!isInitial(splitPoint)) { requestedExclusives.add(splitPoint); } startLoadingNextFragment(); }
/** * Inform the loader that a fragment has now finished loading. */ void fragmentHasLoaded(int fragment) { logFragmentLoaded(fragment); if (fragment < pendingDownloadErrorHandlers.length) { pendingDownloadErrorHandlers[fragment] = null; } /** * It is possible for a fragment to be preloaded by the linker or server before runAsync() has * requested it, in this case the leftovers fragment will be have it's onLoad() called before * remainingInitialFragments has been initialized. */ if (isInitial(fragment) && remainingInitialFragments != null) { assert (fragment == remainingInitialFragments.peek()); remainingInitialFragments.remove(); } assert (fragment == fragmentLoading); fragmentLoading = -1; assert !isLoaded[fragment]; isLoaded[fragment] = true; startLoadingNextFragment(); }
/** * Requests a load of the code for the specified split point. If the load * fails, <code>loadErrorHandler</code> will be invoked. If it succeeds, then * the code will be installed, and the code is expected to invoke its own * on-success hooks, including a call to either * {@link #leftoversFragmentHasLoaded()} or {@link #fragmentHasLoaded(int)}. * * @param splitPoint the split point whose code needs to be loaded */ void inject(int splitPoint, LoadTerminatedHandler loadErrorHandler) { pendingDownloadErrorHandlers[splitPoint] = loadErrorHandler; if (!isInitial(splitPoint)) { requestedExclusives.add(splitPoint); } startLoadingNextFragment(); }
/** * Requests a load of the code for the specified split point. If the load * fails, <code>loadErrorHandler</code> will be invoked. If it succeeds, then * the code will be installed, and the code is expected to invoke its own * on-success hooks, including a call to either * {@link #leftoversFragmentHasLoaded()} or {@link #fragmentHasLoaded(int)}. * * @param splitPoint the split point whose code needs to be loaded */ void inject(int splitPoint, LoadTerminatedHandler loadErrorHandler) { pendingDownloadErrorHandlers[splitPoint] = loadErrorHandler; if (!isInitial(splitPoint)) { requestedExclusives.add(splitPoint); } startLoadingNextFragment(); }
/** * Inform the loader that a fragment has now finished loading. */ void fragmentHasLoaded(int fragment) { logFragmentLoaded(fragment); if (fragment < pendingDownloadErrorHandlers.length) { pendingDownloadErrorHandlers[fragment] = null; } if (isInitial(fragment)) { assert (fragment == remainingInitialFragments.peek()); remainingInitialFragments.remove(); } assert (fragment == fragmentLoading); fragmentLoading = -1; assert !isLoaded[fragment]; isLoaded[fragment] = true; startLoadingNextFragment(); }
/** * Inform the loader that a fragment has now finished loading. */ void fragmentHasLoaded(int fragment) { logFragmentLoaded(fragment); if (fragment < pendingDownloadErrorHandlers.length) { pendingDownloadErrorHandlers[fragment] = null; } if (isInitial(fragment)) { assert (fragment == remainingInitialFragments.peek()); remainingInitialFragments.remove(); } assert (fragment == fragmentLoading); fragmentLoading = -1; assert !isLoaded[fragment]; isLoaded[fragment] = true; startLoadingNextFragment(); }