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

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

Issue 611393002: Rationalize and fix chromium android linker histogram recording. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/Linker.java
diff --git a/base/android/java/src/org/chromium/base/library_loader/Linker.java b/base/android/java/src/org/chromium/base/library_loader/Linker.java
index 2a3006ad174741b127dd62194b72abfbd2e21bf1..abb597861eaddb4d3f3d862775edd0eab2deb6b4 100644
--- a/base/android/java/src/org/chromium/base/library_loader/Linker.java
+++ b/base/android/java/src/org/chromium/base/library_loader/Linker.java
@@ -769,27 +769,28 @@ public class Linker {
loadAddress = sCurrentLoadAddress;
}
+ String errorMessage = null;
String sharedRelRoName = libName;
if (zipFile != null) {
- if (!nativeLoadLibraryInZipFile(
- zipFile, libName, loadAddress, libInfo)) {
- String errorMessage =
- "Unable to load library: " + libName + " in: " +
- zipFile;
- Log.e(TAG, errorMessage);
- throw new UnsatisfiedLinkError(errorMessage);
+ if (!nativeLoadLibraryInZipFile(zipFile, libName, loadAddress, libInfo)) {
+ errorMessage = "Unable to load library: " + libName + " in: " + zipFile;
}
sharedRelRoName = zipFile;
} else {
if (!nativeLoadLibrary(libName, loadAddress, libInfo)) {
- String errorMessage = "Unable to load library: " + libName;
- Log.e(TAG, errorMessage);
- throw new UnsatisfiedLinkError(errorMessage);
+ errorMessage = "Unable to load library: " + libName;
}
}
- // Keep track whether the library has been loaded at the expected load address.
- if (loadAddress != 0 && loadAddress != libInfo.mLoadAddress)
- sLoadAtFixedAddressFailed = true;
+
+ // If loading failed, note any new failure to use a fixed address, then log
+ // and throw an UnsatisfiedLinkError.
+ if (errorMessage != null) {
+ if (loadAddress != 0) {
+ sLoadAtFixedAddressFailed = true;
rmcilroy 2014/10/01 12:14:42 Does this only happen when there is an errorMessag
simonb (inactive) 2014/10/02 15:15:30 Yes. However, it can be deleted, because of what
+ }
+ Log.e(TAG, errorMessage);
+ throw new UnsatisfiedLinkError(errorMessage);
+ }
// Print the load address to the logcat when testing the linker. The format
// of the string is expected by the Python test_runner script as one of:

Powered by Google App Engine
This is Rietveld 408576698