| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.os.Handler; | 7 import android.os.Handler; |
| 8 import android.os.StrictMode; | 8 import android.os.StrictMode; |
| 9 | 9 |
| 10 import org.chromium.base.ContextUtils; | 10 import org.chromium.base.ContextUtils; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 if (sInstance == null) { | 130 if (sInstance == null) { |
| 131 assert LibraryProcessType.PROCESS_BROWSER == libraryProcessType | 131 assert LibraryProcessType.PROCESS_BROWSER == libraryProcessType |
| 132 || LibraryProcessType.PROCESS_WEBVIEW == libraryProcessType; | 132 || LibraryProcessType.PROCESS_WEBVIEW == libraryProcessType; |
| 133 sInstance = new BrowserStartupController(libraryProcessType); | 133 sInstance = new BrowserStartupController(libraryProcessType); |
| 134 } | 134 } |
| 135 assert sInstance.mLibraryProcessType == libraryProcessType : "Wrong proc
ess type"; | 135 assert sInstance.mLibraryProcessType == libraryProcessType : "Wrong proc
ess type"; |
| 136 return sInstance; | 136 return sInstance; |
| 137 } | 137 } |
| 138 | 138 |
| 139 @VisibleForTesting | 139 @VisibleForTesting |
| 140 static BrowserStartupController overrideInstanceForTest(BrowserStartupContro
ller controller) { | 140 public static BrowserStartupController overrideInstanceForTest( |
| 141 if (sInstance == null) { | 141 BrowserStartupController controller) { |
| 142 sInstance = controller; | 142 sInstance = controller; |
| 143 } | |
| 144 return sInstance; | 143 return sInstance; |
| 145 } | 144 } |
| 146 | 145 |
| 147 /** | 146 /** |
| 148 * Start the browser process asynchronously. This will set up a queue of UI
thread tasks to | 147 * Start the browser process asynchronously. This will set up a queue of UI
thread tasks to |
| 149 * initialize the browser process. | 148 * initialize the browser process. |
| 150 * <p/> | 149 * <p/> |
| 151 * Note that this can only be called on the UI thread. | 150 * Note that this can only be called on the UI thread. |
| 152 * | 151 * |
| 153 * @param startGpuProcess Whether to start the GPU process if it is not star
ted. | 152 * @param startGpuProcess Whether to start the GPU process if it is not star
ted. |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 349 |
| 351 private static native void nativeSetCommandLineFlags( | 350 private static native void nativeSetCommandLineFlags( |
| 352 boolean singleProcess, String pluginDescriptor); | 351 boolean singleProcess, String pluginDescriptor); |
| 353 | 352 |
| 354 // Is this an official build of Chrome? Only native code knows for sure. Off
icial build | 353 // Is this an official build of Chrome? Only native code knows for sure. Off
icial build |
| 355 // knowledge is needed very early in process startup. | 354 // knowledge is needed very early in process startup. |
| 356 private static native boolean nativeIsOfficialBuild(); | 355 private static native boolean nativeIsOfficialBuild(); |
| 357 | 356 |
| 358 private static native boolean nativeIsPluginEnabled(); | 357 private static native boolean nativeIsPluginEnabled(); |
| 359 } | 358 } |
| OLD | NEW |