當前位置: 首頁>>代碼示例>>Java>>正文


Java PrecacheController類代碼示例

本文整理匯總了Java中org.chromium.chrome.browser.precache.PrecacheController的典型用法代碼示例。如果您正苦於以下問題:Java PrecacheController類的具體用法?Java PrecacheController怎麽用?Java PrecacheController使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PrecacheController類屬於org.chromium.chrome.browser.precache包,在下文中一共展示了PrecacheController類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: launchBrowser

import org.chromium.chrome.browser.precache.PrecacheController; //導入依賴的package包/類
@VisibleForTesting
@SuppressFBWarnings("DM_EXIT")
protected void launchBrowser(Context context, String tag) {
    Log.i(TAG, "Launching browser");
    try {
        ChromeBrowserInitializer.getInstance(this).handleSynchronousStartup();
    } catch (ProcessInitException e) {
        Log.e(TAG, "ProcessInitException while starting the browser process");
        switch (tag) {
            case PrecacheController.PERIODIC_TASK_TAG:
            case PrecacheController.CONTINUATION_TASK_TAG:
                // Record the failure persistently, and upload to UMA when the library
                // successfully loads next time.
                PrecacheUMA.record(PrecacheUMA.Event.PRECACHE_TASK_LOAD_LIBRARY_FAIL);
                break;
            default:
                break;
        }
        // Since the library failed to initialize nothing in the application
        // can work, so kill the whole application not just the activity.
        System.exit(-1);
    }
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:24,代碼來源:ChromeBackgroundService.java

示例2: onRunTask

import org.chromium.chrome.browser.precache.PrecacheController; //導入依賴的package包/類
@Override
@VisibleForTesting
public int onRunTask(final TaskParams params) {
    final String taskTag = params.getTag();
    Log.i(TAG, "[" + taskTag + "] Woken up at " + new java.util.Date().toString());
    final ChromeBackgroundServiceWaiter waiter = getWaiterIfNeeded(params.getExtras());
    final Context context = this;
    ThreadUtils.runOnUiThread(new Runnable() {
        @Override
        public void run() {
            switch (taskTag) {
                case BackgroundSyncLauncher.TASK_TAG:
                    handleBackgroundSyncEvent(context, taskTag);
                    break;

                case OfflinePageUtils.TASK_TAG:
                    handleOfflinePageBackgroundLoad(
                            context, params.getExtras(), waiter, taskTag);
                    break;

                case SnippetsLauncher.TASK_TAG_WIFI:
                case SnippetsLauncher.TASK_TAG_FALLBACK:
                    handleFetchSnippets(context, taskTag);
                    break;

                case PrecacheController.PERIODIC_TASK_TAG:
                case PrecacheController.CONTINUATION_TASK_TAG:
                    handlePrecache(context, taskTag);
                    break;

                case DownloadResumptionScheduler.TASK_TAG:
                    DownloadResumptionScheduler.getDownloadResumptionScheduler(
                            context.getApplicationContext()).handleDownloadResumption();
                    break;

                default:
                    Log.i(TAG, "Unknown task tag " + taskTag);
                    break;
            }
        }
    });
    // If needed, block the GcmNetworkManager thread until the UI thread has finished its work.
    waitForTaskIfNeeded(waiter);

    return GcmNetworkManager.RESULT_SUCCESS;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:47,代碼來源:ChromeBackgroundService.java

示例3: hasPrecacheInstance

import org.chromium.chrome.browser.precache.PrecacheController; //導入依賴的package包/類
@VisibleForTesting
protected boolean hasPrecacheInstance() {
    return PrecacheController.hasInstance();
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:5,代碼來源:ChromeBackgroundService.java

示例4: precache

import org.chromium.chrome.browser.precache.PrecacheController; //導入依賴的package包/類
@VisibleForTesting
protected void precache(Context context, String tag) {
    PrecacheController.get(context).precache(tag);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:5,代碼來源:ChromeBackgroundService.java

示例5: reschedulePrecacheTasksOnUpgrade

import org.chromium.chrome.browser.precache.PrecacheController; //導入依賴的package包/類
@VisibleForTesting
protected void reschedulePrecacheTasksOnUpgrade() {
    PrecacheController.rescheduleTasksOnUpgrade(this);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:5,代碼來源:ChromeBackgroundService.java


注:本文中的org.chromium.chrome.browser.precache.PrecacheController類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。