/** * Specify which resources should be prefetched. */ public static void prefetch(Iterable<? extends PrefetchableResource> resources) { if (!GWT.isScript()) { // Nothing to do in development mode return; } // No range checking in Production Mode means we needn't precompute the size int[] runAsyncSplitPoints = new int[0]; int i = 0; for (PrefetchableResource resource : resources) { if (resource instanceof RunAsyncCode) { RunAsyncCode resourceRunAsync = (RunAsyncCode) resource; int splitPoint = resourceRunAsync.getSplitPoint(); if (splitPoint >= 0) { // Skip placeholders, which have a -1 split point runAsyncSplitPoints[i++] = splitPoint; } continue; } throw new IllegalArgumentException("Unknown resource type: " + resource.getClass()); } AsyncFragmentLoader.BROWSER_LOADER.setPrefetchQueue(runAsyncSplitPoints); }
/** * Specify which resources should be prefetched. */ public static void prefetch(Iterable<? extends PrefetchableResource> resources) { if (!GWT.isScript()) { // Nothing to do in development mode return; } // No range checking in Production Mode means we needn't precompute the size int[] runAsyncSplitPoints = new int[0]; int i = 0; for (PrefetchableResource resource : resources) { if (resource instanceof RunAsyncCode) { RunAsyncCode resourceRunAsync = (RunAsyncCode) resource; int splitPoint = resourceRunAsync.getSplitPoint(); if (splitPoint >= 0) { // Skip placeholders, which have a -1 split point runAsyncSplitPoints[i++] = splitPoint; } continue; } throw new IllegalArgumentException("Unknown resource type: " + resource.getClass()); } AsyncFragmentLoader.BROWSER_LOADER.setPrefetchQueue(runAsyncSplitPoints); }
/** * Specify which resources should be prefetched. */ public static void prefetch(Iterable<? extends PrefetchableResource> resources) { if (!GWT.isScript()) { // Nothing to do in development mode return; } // No range checking in Production Mode means we needn't precompute the size int[] runAsyncSplitPoints = new int[0]; int i = 0; for (PrefetchableResource resource : resources) { if (resource instanceof RunAsyncCode) { RunAsyncCode resourceRunAsync = (RunAsyncCode) resource; int splitPoint = resourceRunAsync.getSplitPoint(); if (splitPoint >= 0) { // Skip placeholders, which have a -1 split point runAsyncSplitPoints[i++] = splitPoint; } continue; } throw new IllegalArgumentException("Unknown resource type: " + resource.getClass()); } AsyncFragmentLoader.BROWSER_LOADER.setPrefetchQueue(runAsyncSplitPoints); }