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

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

Issue 663543003: Fix low-memory devices crashing on Chrome start up during UMA recodring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed LibraryLoader.onNativeInitializationComplete() with no arguments 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 819fe3df5e49486d5e2e53a5c0f0668ad69c7ca8..ddefbbf5f8207920136e4e99e5bf8e74af7b5f14 100644
--- a/base/android/library_loader/library_loader_hooks.cc
+++ b/base/android/library_loader/library_loader_hooks.cc
@@ -46,12 +46,11 @@ 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,
+enum LibraryLoadFromApkStatusCode {
+#define DEFINE_LIBRARY_LOAD_FROM_APK_STATUS_CODE(name, value) \
+ LIBRARY_LOAD_FROM_APK_STATUS_CODE_##name = value,
+#include "library_load_from_apk_status_codes.h"
+#undef DEFINE_LIBRARY_LOAD_FROM_APK_STATUS_CODE
};
} // namespace
@@ -85,7 +84,7 @@ static void RecordChromiumAndroidLinkerBrowserHistogram(
jclass clazz,
jboolean is_using_browser_shared_relros,
jboolean load_at_fixed_address_failed,
- jboolean library_load_from_apk_supported) {
+ jint library_load_from_apk_status) {
// 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;
@@ -99,12 +98,10 @@ static void RecordChromiumAndroidLinkerBrowserHistogram(
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);
+ // Record the device support for loading a library directly from the APK file.
+ UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.LibraryLoadFromApkStatus",
+ library_load_from_apk_status,
+ LIBRARY_LOAD_FROM_APK_STATUS_CODE_MAX);
}
void SetLibraryLoadedHook(LibraryLoadedHook* func) {

Powered by Google App Engine
This is Rietveld 408576698