Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1126)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java

Issue 11567061: Throw exception when initialization failed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java b/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
index 6f62a71c015f8dddacbb719c27e437c21207f53e..5c4aad79dda4053047172a803c888b7d0e2c71b7 100644
--- a/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
+++ b/content/public/android/java/src/org/chromium/content/browser/AndroidBrowserProcess.java
@@ -16,6 +16,7 @@ import org.chromium.base.JNINamespace;
import org.chromium.content.app.ContentMain;
import org.chromium.content.app.LibraryLoader;
import org.chromium.content.common.CommandLine;
+import org.chromium.content.common.ProcessInitException;
import org.chromium.content.R;
// NOTE: This file hasn't been fully upstreamed, please don't merge to downstream.
@@ -69,7 +70,8 @@ public class AndroidBrowserProcess {
* @param maxRendererProcesses See ContentView.enableMultiProcess().
* @return Whether the process actually needed to be initialized (false if already running).
*/
- public static boolean initContentViewProcess(Context context, int maxRendererProcesses) {
+ public static boolean initContentViewProcess(Context context, int maxRendererProcesses)
+ throws ProcessInitException {
return genericChromiumProcessInit(context, maxRendererProcesses, false);
}
@@ -81,7 +83,8 @@ public class AndroidBrowserProcess {
* @param maxRendererProcesses See ContentView.enableMultiProcess().
* @return Whether the process actually needed to be initialized (false if already running).
*/
- public static boolean initChromiumBrowserProcess(Context context, int maxRendererProcesses) {
+ public static boolean initChromiumBrowserProcess(Context context, int maxRendererProcesses)
+ throws ProcessInitException {
return genericChromiumProcessInit(context, maxRendererProcesses, true);
}
@@ -93,7 +96,7 @@ public class AndroidBrowserProcess {
* @return Whether the process actually needed to be initialized (false if already running).
*/
private static boolean genericChromiumProcessInit(Context context, int maxRendererProcesses,
- boolean hostIsChrome) {
+ boolean hostIsChrome) throws ProcessInitException {
if (sInitialized) return false;
sInitialized = true;
@@ -156,7 +159,8 @@ public class AndroidBrowserProcess {
nativeSetCommandLineFlags(maxRenderers);
ContentMain.initApplicationContext(appContext);
- ContentMain.start();
+ int result = ContentMain.start();
+ if (result > 0) throw new ProcessInitException(result);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698