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

Unified Diff: content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.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/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java
diff --git a/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java b/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java
index a0d16829fbf76858160b687877671df15ec3d32b..cd3e546e35c5da3122ba26f3338fd8b96b881529 100644
--- a/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java
+++ b/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java
@@ -22,6 +22,7 @@ import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.DeviceUtils;
import org.chromium.content.browser.TracingIntentHandler;
import org.chromium.content.common.CommandLine;
+import org.chromium.content.common.ProcessInitException;
import org.chromium.ui.gfx.ActivityNativeWindow;
/**
@@ -59,29 +60,32 @@ public class ContentShellActivity extends ChromiumActivity {
waitForDebuggerIfNeeded();
DeviceUtils.addDeviceSpecificUserAgentSwitch(this);
-
- LibraryLoader.ensureInitialized();
-
- setContentView(R.layout.content_shell_activity);
- mShellManager = (ShellManager) findViewById(R.id.shell_container);
- mActivityNativeWindow = new ActivityNativeWindow(this);
- mActivityNativeWindow.restoreInstanceState(savedInstanceState);
- mShellManager.setWindow(mActivityNativeWindow);
- ContentVideoView.registerContentVideoViewContextDelegate(
- new ActivityContentVideoViewDelegate(this));
-
- String startupUrl = getUrlFromIntent(getIntent());
- if (!TextUtils.isEmpty(startupUrl)) {
- mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
- }
-
- if (!ContentView.enableMultiProcess(this, ContentView.MAX_RENDERERS_AUTOMATIC)) {
- String shellUrl = DEFAULT_SHELL_URL;
- if (savedInstanceState != null
+ try {
+ LibraryLoader.ensureInitialized();
+
+ setContentView(R.layout.content_shell_activity);
+ mShellManager = (ShellManager) findViewById(R.id.shell_container);
+ mActivityNativeWindow = new ActivityNativeWindow(this);
+ mActivityNativeWindow.restoreInstanceState(savedInstanceState);
+ mShellManager.setWindow(mActivityNativeWindow);
+ ContentVideoView.registerContentVideoViewContextDelegate(
+ new ActivityContentVideoViewDelegate(this));
+
+ String startupUrl = getUrlFromIntent(getIntent());
+ if (!TextUtils.isEmpty(startupUrl)) {
+ mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
+ }
+ if (!ContentView.enableMultiProcess(this, ContentView.MAX_RENDERERS_AUTOMATIC)) {
+ String shellUrl = DEFAULT_SHELL_URL;
+ if (savedInstanceState != null
&& savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) {
- shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
+ shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
+ }
+ mShellManager.launchShell(shellUrl);
}
- mShellManager.launchShell(shellUrl);
+ } catch (ProcessInitException e) {
+ Log.e(TAG, "ContentView initialization failed.", e);
+ finish();
}
}
« no previous file with comments | « content/public/common/result_codes.h ('k') | testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698