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

Unified Diff: content/public/android/java/src/org/chromium/content/app/LibraryLoader.java

Issue 12464004: Handle LibraryLoader error from the renderer process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase gypi Created 7 years, 9 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/public/android/java/src/org/chromium/content/app/LibraryLoader.java
diff --git a/content/public/android/java/src/org/chromium/content/app/LibraryLoader.java b/content/public/android/java/src/org/chromium/content/app/LibraryLoader.java
index 91e3234328d6afe88df43a14b63a1bcb50749b73..0facd0b31ebae5194207e36db3a03283334bb954 100644
--- a/content/public/android/java/src/org/chromium/content/app/LibraryLoader.java
+++ b/content/public/android/java/src/org/chromium/content/app/LibraryLoader.java
@@ -4,14 +4,13 @@
package org.chromium.content.app;
-import android.os.AsyncTask;
-import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import org.chromium.base.JNINamespace;
import org.chromium.content.common.CommandLine;
import org.chromium.content.common.ProcessInitException;
+import org.chromium.content.common.ResultCodes;
import org.chromium.content.common.TraceEvent;
/**
@@ -78,20 +77,24 @@ public class LibraryLoader {
* this is called on will be the thread that runs the native code's static initializers.
* See the comment in doInBackground() for more considerations on this.
*
- * @return Whether the native library was successfully loaded.
+ * @throws ProcessInitException if the native library failed to load.
*/
- public static void loadNow() {
+ public static void loadNow() throws ProcessInitException {
if (sLibrary == null) {
assert false : "No library specified to load. Call setLibraryToLoad before first.";
}
- synchronized (sLoadedLock) {
- if (!sLoaded) {
- assert !sInitialized;
- Log.i(TAG, "loading: " + sLibrary);
- System.loadLibrary(sLibrary);
- Log.i(TAG, "loaded: " + sLibrary);
- sLoaded = true;
+ try {
+ synchronized (sLoadedLock) {
+ if (!sLoaded) {
+ assert !sInitialized;
+ Log.i(TAG, "loading: " + sLibrary);
+ System.loadLibrary(sLibrary);
+ Log.i(TAG, "loaded: " + sLibrary);
+ sLoaded = true;
+ }
}
+ } catch (UnsatisfiedLinkError e) {
+ throw new ProcessInitException(ResultCodes.RESULT_CODE_NATIVE_LIBRARY_LOAD_FAILED, e);
}
}
« no previous file with comments | « content/content_common.gypi ('k') | content/public/android/java/src/org/chromium/content/app/SandboxedProcessService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698