diff options
author | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 21:43:18 +0000 |
---|---|---|
committer | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 21:43:18 +0000 |
commit | 86ebc8f3731a84fea14e8688da4eb55aba87008a (patch) | |
tree | 2639dccb20377423690fa69468c1df9a0e6de31d /chrome/android | |
parent | f5411e2e50d20ad0c54336fd552a86f36f2b9e63 (diff) | |
download | chromium_src-86ebc8f3731a84fea14e8688da4eb55aba87008a.zip chromium_src-86ebc8f3731a84fea14e8688da4eb55aba87008a.tar.gz chromium_src-86ebc8f3731a84fea14e8688da4eb55aba87008a.tar.bz2 |
Throw exception when initialization failed.
Previously the initialization return code was ignored, it will lead us
crash later. We need a way to exit and maybe show error message if something
wrong during initialization.
Using exception might better than returning the result code since the
initialization code could be called from constructor and initialization
error is an exception at most of time.
In activity, the exception is caught, then call finish() to exit.
In tests, the exception is wrapped with Error and threw out.
BUG=b/7705055
Review URL: https://chromiumcodereview.appspot.com/11567061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176975 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/android')
-rw-r--r-- | chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java index b8cb09f..4d9e6b7 100644 --- a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java +++ b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java @@ -18,6 +18,7 @@ import org.chromium.content.app.LibraryLoader; import org.chromium.content.browser.ContentView; import org.chromium.content.browser.DeviceUtils; import org.chromium.content.common.CommandLine; +import org.chromium.content.common.ProcessInitException; import org.chromium.ui.gfx.ActivityNativeWindow; /** @@ -40,9 +41,12 @@ public class ChromiumTestShellActivity extends ChromiumActivity { waitForDebuggerIfNeeded(); DeviceUtils.addDeviceSpecificUserAgentSwitch(this); - - ContentView.initChromiumBrowserProcess(this, ContentView.MAX_RENDERERS_AUTOMATIC); - + try { + ContentView.initChromiumBrowserProcess(this, ContentView.MAX_RENDERERS_AUTOMATIC); + } catch (ProcessInitException e) { + Log.e(TAG, "Chromium browser process initialization failed", e); + finish(); + } setContentView(R.layout.testshell_activity); mTabManager = (TabManager) findViewById(R.id.tab_manager); String startupUrl = getUrlFromIntent(getIntent()); |