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

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: Large update for review feedback 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..ba37bfff29a8a53451aa754938f6d36179dcce58 100644
--- a/base/android/library_loader/library_loader_hooks.cc
+++ b/base/android/library_loader/library_loader_hooks.cc
@@ -47,11 +47,10 @@ 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,
+#define DEFINE_LIBRARY_LOAD_FROM_APK_SUPPORT_CODE(name, value) \
+ LIBRARY_LOAD_FROM_APK_SUPPORT_CODE_##name = value,
+#include "library_load_from_apk_support_code.h"
+#undef DEFINE_LIBRARY_LOAD_FROM_APK_SUPPORT_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_support) {
// 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.LibraryLoadFromApkSupport",
+ library_load_from_apk_support,
+ LIBRARY_LOAD_FROM_APK_SUPPORT_CODE_MAX);
}
void SetLibraryLoadedHook(LibraryLoadedHook* func) {

Powered by Google App Engine
This is Rietveld 408576698