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


Java ProcessInitializationHandler類代碼示例

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


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

示例1: getOrCreateSyncAdapter

import org.chromium.chrome.browser.init.ProcessInitializationHandler; //導入依賴的package包/類
/**
 * Get the sync adapter reference, creating an instance if necessary.
 */
private ChromeBrowserSyncAdapter getOrCreateSyncAdapter(Context applicationContext) {
    synchronized (LOCK) {
        if (sSyncAdapter == null) {
            ProcessInitializationHandler.getInstance().initializePreNative();
            sSyncAdapter = new ChromeBrowserSyncAdapter(applicationContext, getApplication());
        }
    }
    return sSyncAdapter;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:13,代碼來源:ChromeBrowserSyncAdapterService.java

示例2: onCreate

import org.chromium.chrome.browser.init.ProcessInitializationHandler; //導入依賴的package包/類
@Override
public void onCreate() {
    ProcessInitializationHandler.getInstance().initializePreNative();
    // Kick off the first access to avoid random StrictMode violations in clients.
    RequestThrottler.loadInBackground(getApplication());
    super.onCreate();
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:8,代碼來源:CustomTabsConnectionService.java

示例3: initDeferredStartupForApp

import org.chromium.chrome.browser.init.ProcessInitializationHandler; //導入依賴的package包/類
/**
 * Handle application level deferred startup tasks that can be lazily done after all
 * the necessary initialization has been completed. Any calls requiring network access should
 * probably go here.
 *
 * Keep these tasks short and break up long tasks into multiple smaller tasks, as they run on
 * the UI thread and are blocking. Remember to follow RAIL guidelines, as much as possible, and
 * that most devices are quite slow, so leave enough buffer.
 */
@UiThread
public void initDeferredStartupForApp() {
    if (mDeferredStartupInitializedForApp) return;
    mDeferredStartupInitializedForApp = true;
    ThreadUtils.assertOnUiThread();

    RecordHistogram.recordLongTimesHistogram(
            "UMA.Debug.EnableCrashUpload.DeferredStartUptime2",
            SystemClock.uptimeMillis() - UmaUtils.getForegroundStartTime(),
            TimeUnit.MILLISECONDS);

    mDeferredTasks.add(new Runnable() {
        @Override
        public void run() {
            // Punt all tasks that may block on disk off onto a background thread.
            initAsyncDiskTask();

            AfterStartupTaskUtils.setStartupComplete();

            PartnerBrowserCustomizations.setOnInitializeAsyncFinished(new Runnable() {
                @Override
                public void run() {
                    String homepageUrl = HomepageManager.getHomepageUri(mAppContext);
                    LaunchMetrics.recordHomePageLaunchMetrics(
                            HomepageManager.isHomepageEnabled(mAppContext),
                            NewTabPage.isNTPUrl(homepageUrl), homepageUrl);
                }
            });

            PartnerBookmarksShim.kickOffReading(mAppContext);

            PowerMonitor.create(mAppContext);

            ShareHelper.clearSharedImages();

            OfflinePageUtils.clearSharedOfflineFiles(mAppContext);
        }
    });

    mDeferredTasks.add(new Runnable() {
        @Override
        public void run() {
            // Clear any media notifications that existed when Chrome was last killed.
            MediaCaptureNotificationService.clearMediaNotifications(mAppContext);

            startModerateBindingManagementIfNeeded();

            recordKeyboardLocaleUma();
        }
    });

    mDeferredTasks.add(new Runnable() {
        @Override
        public void run() {
            // Start or stop Physical Web
            PhysicalWeb.onChromeStart();
        }
    });

    final ChromeApplication application = (ChromeApplication) mAppContext;

    mDeferredTasks.add(new Runnable() {
        @Override
        public void run() {
            // Starts syncing with GSA.
            application.createGsaHelper().startSync();
        }
    });

    ProcessInitializationHandler.getInstance().initializeDeferredStartupTasks();
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:81,代碼來源:DeferredStartupHandler.java

示例4: onCreate

import org.chromium.chrome.browser.init.ProcessInitializationHandler; //導入依賴的package包/類
@Override
public void onCreate() {
    ProcessInitializationHandler.getInstance().initializePreNative();
    super.onCreate();
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:6,代碼來源:CustomTabsConnectionService.java

示例5: createProcessInitializationHandler

import org.chromium.chrome.browser.init.ProcessInitializationHandler; //導入依賴的package包/類
/**
 * @return a new {@link ProcessInitializationHandler} instance.
 */
public ProcessInitializationHandler createProcessInitializationHandler() {
    return new ProcessInitializationHandler();
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:7,代碼來源:AppHooks.java

示例6: onDeferredStartup

import org.chromium.chrome.browser.init.ProcessInitializationHandler; //導入依賴的package包/類
/**
 * Actions that may be run at some point after startup. Place tasks that are not critical to the
 * startup path here.  This method will be called automatically and should not be called
 * directly by subclasses.
 *
 * Overriding methods should queue tasks on the DeferredStartupHandler before or after calling
 * super depending on whether the tasks should run before or after these ones.
 */
protected void onDeferredStartup() {
    initDeferredStartupForActivity();
    ProcessInitializationHandler.getInstance().initializeDeferredStartupTasks();
    DeferredStartupHandler.getInstance().queueDeferredTasksOnIdleHandler();
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:14,代碼來源:ChromeActivity.java


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