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

Unified Diff: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java

Issue 59533009: Check library version and handle library load errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix BrowserStartupControllerTest Created 7 years, 1 month 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/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);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698