Index: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java |
diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java |
index dc3e9b03fde64c8b114f2a5211051dcea2a51151..416662394beb10999f22c58588ca64b6f0a33666 100644 |
--- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java |
+++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java |
@@ -62,7 +62,9 @@ public class ContentShellActivity extends Activity { |
LibraryLoader.ensureInitialized(); |
} catch (ProcessInitException e) { |
Log.e(TAG, "ContentView initialization failed.", e); |
- finish(); |
+ // Since the library failed to initialize nothing in the application |
+ // can work, so kill the whole application not just the activity |
+ System.exit(-1); |
return; |
} |
@@ -78,25 +80,33 @@ public class ContentShellActivity extends Activity { |
} |
if (CommandLine.getInstance().hasSwitch(ContentSwitches.DUMP_RENDER_TREE)) { |
- if(BrowserStartupController.get(this).startBrowserProcessesSync( |
- BrowserStartupController.MAX_RENDERERS_LIMIT)) { |
- finishInitialization(savedInstanceState); |
- } else { |
- initializationFailed(); |
+ try { |
+ BrowserStartupController.get(this).startBrowserProcessesSync( |
+ BrowserStartupController.MAX_RENDERERS_LIMIT); |
+ } |
+ catch (ProcessInitException e) { |
+ Log.e(TAG, "Failed to load native library.", e); |
+ System.exit(-1); |
} |
} else { |
- BrowserStartupController.get(this).startBrowserProcessesAsync( |
- new BrowserStartupController.StartupCallback() { |
- @Override |
- public void onSuccess(boolean alreadyStarted) { |
- finishInitialization(savedInstanceState); |
- } |
- |
- @Override |
- public void onFailure() { |
- initializationFailed(); |
- } |
- }); |
+ try { |
+ BrowserStartupController.get(this).startBrowserProcessesAsync( |
+ new BrowserStartupController.StartupCallback() { |
+ @Override |
+ public void onSuccess(boolean alreadyStarted) { |
+ finishInitialization(savedInstanceState); |
+ } |
+ |
+ @Override |
+ public void onFailure() { |
+ initializationFailed(); |
+ } |
+ }); |
+ } |
+ catch (ProcessInitException e) { |
+ Log.e(TAG, "Unable to load native library.", e); |
+ System.exit(-1); |
+ } |
} |
} |