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

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

Issue 201543002: Remove a unused method and fix some styles according to the style guide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9dc77fc8c006cfdb5c1c5c9d40327833f75f7cd2..4e159553d725d095b593ef8fe911264250873ba6 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
@@ -41,14 +41,6 @@ public class LibraryLoader {
// library_loader_hooks.cc).
private static boolean sInitialized = false;
- // TODO(cjhopman): Remove this once it's unused.
- /**
- * Doesn't do anything.
- */
- @Deprecated
- public static void setLibraryToLoad(String library) {
- }
-
/**
* This method blocks until the library is fully loaded and initialized.
*/
@@ -87,7 +79,6 @@ public class LibraryLoader {
}
}
-
/**
* initializes the library here and now: must be called on the thread that the
* native will call its "main" thread. The library must have previously been
@@ -101,7 +92,6 @@ public class LibraryLoader {
}
}
-
// Invoke System.loadLibrary(...), triggering JNI_OnLoad in native code
private static void loadAlreadyLocked() throws ProcessInitException {
try {
@@ -111,23 +101,22 @@ public class LibraryLoader {
long startTime = SystemClock.uptimeMillis();
boolean useChromiumLinker = Linker.isUsed();
- if (useChromiumLinker)
- Linker.prepareLibraryLoad();
+ if (useChromiumLinker) Linker.prepareLibraryLoad();
for (String library : NativeLibraries.LIBRARIES) {
Log.i(TAG, "Loading: " + library);
- if (useChromiumLinker)
+ if (useChromiumLinker) {
Linker.loadLibrary(library);
- else
+ } else {
System.loadLibrary(library);
+ }
}
- if (useChromiumLinker)
- Linker.finishLibraryLoad();
+ if (useChromiumLinker) Linker.finishLibraryLoad();
long stopTime = SystemClock.uptimeMillis();
Log.i(TAG, String.format("Time to load native libraries: %d ms (timestamps %d-%d)",
- stopTime - startTime,
- startTime % 10000,
- stopTime % 10000));
+ stopTime - startTime,
+ startTime % 10000,
+ stopTime % 10000));
sLoaded = true;
}
} catch (UnsatisfiedLinkError e) {
@@ -142,10 +131,8 @@ public class LibraryLoader {
if (!NativeLibraries.VERSION_NUMBER.equals(nativeGetVersionNumber())) {
throw new ProcessInitException(LoaderErrors.LOADER_ERROR_NATIVE_LIBRARY_WRONG_VERSION);
}
-
}
-
// Invoke base::android::LibraryLoaded in library_loader_hooks.cc
private static void initializeAlreadyLocked(String[] initCommandLine)
throws ProcessInitException {
@@ -163,9 +150,10 @@ public class LibraryLoader {
CommandLine.enableNativeProxy();
TraceEvent.setEnabledToMatchNative();
// Record histogram for the Chromium linker.
- if (Linker.isUsed())
+ if (Linker.isUsed()) {
nativeRecordChromiumAndroidLinkerHistogram(Linker.loadAtFixedAddressFailed(),
- SysUtils.isLowEndDevice());
+ SysUtils.isLowEndDevice());
+ }
}
// Only methods needed before or during normal JNI registration are during System.OnLoad.
@@ -180,8 +168,8 @@ public class LibraryLoader {
// i.e. whether the library failed to be loaded at a fixed address, and
// whether the device is 'low-memory'.
private static native void nativeRecordChromiumAndroidLinkerHistogram(
- boolean loadedAtFixedAddressFailed,
- boolean isLowMemoryDevice);
+ boolean loadedAtFixedAddressFailed,
+ boolean isLowMemoryDevice);
// Get the version of the native library. This is needed so that we can check we
// have the right version before initializing the (rest of the) JNI.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698