当前位置: 首页>>代码示例>>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;未经允许,请勿转载。