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

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: Respond to second round of review comments. 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 14c8d1cf2bb612bea92fe52d99ddd6e6c477f923..523be668e845bf6aa799d33209b6d49c48c97cd1 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
@@ -60,7 +60,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;
}
@@ -76,25 +78,33 @@ public class ContentShellActivity extends Activity {
}
if (CommandLine.getInstance().hasSwitch(CommandLine.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