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

Unified Diff: base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 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: base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
diff --git a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
index 484c6bc56d55596cdf77610e3cbf8e541c4d3d67..7dc015dc8f9ecb7c420e55046b2351646fb9fd2f 100644
--- a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
+++ b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
@@ -14,6 +14,7 @@ import org.chromium.base.CalledByNative;
import org.chromium.base.CommandLine;
import org.chromium.base.JNINamespace;
import org.chromium.base.TraceEvent;
+import org.chromium.base.VisibleForTesting;
import java.io.File;
import java.io.FileNotFoundException;
@@ -127,6 +128,7 @@ public class LibraryLoader {
*
* @throws ProcessInitException
*/
+ @VisibleForTesting
public void ensureInitialized() throws ProcessInitException {
ensureInitialized(null, false);
}
@@ -353,9 +355,14 @@ public class LibraryLoader {
} else {
// The library is in its own file.
Log.i(TAG, "Loading " + library);
- ApplicationInfo applicationInfo = context.getApplicationInfo();
- mLoadedFrom.put(library, new File(applicationInfo.nativeLibraryDir,
- libFilePath).getAbsolutePath());
+ if (context != null) {
+ ApplicationInfo applicationInfo = context.getApplicationInfo();
+ File file = new File(applicationInfo.nativeLibraryDir, libFilePath);
+ mLoadedFrom.put(library, file.getAbsolutePath());
+ } else {
+ Log.i(TAG, "No context, cannot locate the native library file for "
+ + library);
+ }
}
// Load the library.

Powered by Google App Engine
This is Rietveld 408576698