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

Unified Diff: base/android/library_loader/library_loader_hooks.cc

Issue 643803003: Add UMA for testing whether device supports memory mapping APK files with executable permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase after 611393002 landed Created 6 years, 2 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/library_loader/library_loader_hooks.cc
diff --git a/base/android/library_loader/library_loader_hooks.cc b/base/android/library_loader/library_loader_hooks.cc
index a8c75e1310dc9c93f27f6f95b0f84fd6778de6d8..819fe3df5e49486d5e2e53a5c0f0668ad69c7ca8 100644
--- a/base/android/library_loader/library_loader_hooks.cc
+++ b/base/android/library_loader/library_loader_hooks.cc
@@ -46,6 +46,14 @@ enum BrowserHistogramCode {
RendererHistogramCode g_renderer_histogram_code = NO_PENDING_HISTOGRAM_CODE;
+enum LibraryLoadFromApkSupportCode {
+ // The device's support for loading a library directly from the APK file.
+ NOT_SUPPORTED = 0,
+ SUPPORTED = 1,
+
+ MAX_LIBRARY_LOAD_FROM_APK_SUPPORT_CODE = 2,
+};
+
} // namespace
static void RegisterChromiumAndroidLinkerRendererHistogram(
@@ -76,7 +84,8 @@ static void RecordChromiumAndroidLinkerBrowserHistogram(
JNIEnv* env,
jclass clazz,
jboolean is_using_browser_shared_relros,
- jboolean load_at_fixed_address_failed) {
+ jboolean load_at_fixed_address_failed,
+ jboolean library_load_from_apk_supported) {
// For low-memory devices, record whether or not we successfully loaded the
// browser at a fixed address. Otherwise just record a normal invocation.
BrowserHistogramCode histogram_code;
@@ -89,6 +98,13 @@ static void RecordChromiumAndroidLinkerBrowserHistogram(
UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.BrowserStates",
histogram_code,
MAX_BROWSER_HISTOGRAM_CODE);
+
+ // Record whether the device supports loading a library directly from the APK
+ // file.
+ UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.LibraryLoadFromApkSupported",
+ library_load_from_apk_supported ?
+ SUPPORTED : NOT_SUPPORTED,
+ MAX_LIBRARY_LOAD_FROM_APK_SUPPORT_CODE);
}
void SetLibraryLoadedHook(LibraryLoadedHook* func) {
« no previous file with comments | « base/android/java/src/org/chromium/base/library_loader/Linker.java ('k') | base/android/linker/linker_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698