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 /android_webview/java | |
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 'android_webview/java')
-rw-r--r-- | android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java index 682706a..3e465d6 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java +++ b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java @@ -11,6 +11,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.content.app.LibraryLoader; import org.chromium.content.browser.AndroidBrowserProcess; import org.chromium.content.browser.ResourceExtractor; +import org.chromium.content.common.ProcessInitException; /** * Wrapper for the steps needed to initialize the java and native sides of webview chromium. @@ -46,9 +47,13 @@ public abstract class AwBrowserProcess { ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - LibraryLoader.ensureInitialized(); - AndroidBrowserProcess.initContentViewProcess(context, - AndroidBrowserProcess.MAX_RENDERERS_SINGLE_PROCESS); + try { + LibraryLoader.ensureInitialized(); + AndroidBrowserProcess.initContentViewProcess(context, + AndroidBrowserProcess.MAX_RENDERERS_SINGLE_PROCESS); + } catch (ProcessInitException e) { + throw new RuntimeException("Cannot initialize WebView", e); + } } }); } |