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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/android/library_loader/library_loader_hooks.h" 5 #include "base/android/library_loader/library_loader_hooks.h"
6 6
7 #include "base/android/command_line_android.h" 7 #include "base/android/command_line_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.RendererStates", 69 UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.RendererStates",
70 g_renderer_histogram_code, 70 g_renderer_histogram_code,
71 MAX_RENDERER_HISTOGRAM_CODE); 71 MAX_RENDERER_HISTOGRAM_CODE);
72 g_renderer_histogram_code = NO_PENDING_HISTOGRAM_CODE; 72 g_renderer_histogram_code = NO_PENDING_HISTOGRAM_CODE;
73 } 73 }
74 74
75 static void RecordChromiumAndroidLinkerBrowserHistogram( 75 static void RecordChromiumAndroidLinkerBrowserHistogram(
76 JNIEnv* env, 76 JNIEnv* env,
77 jclass clazz, 77 jclass clazz,
78 jboolean is_using_browser_shared_relros, 78 jboolean is_using_browser_shared_relros,
79 jboolean load_at_fixed_address_failed) { 79 jboolean load_at_fixed_address_failed,
80 jboolean apk_memory_mapping_supported) {
80 // For low-memory devices, record whether or not we successfully loaded the 81 // For low-memory devices, record whether or not we successfully loaded the
81 // browser at a fixed address. Otherwise just record a normal invocation. 82 // browser at a fixed address. Otherwise just record a normal invocation.
82 BrowserHistogramCode histogram_code; 83 BrowserHistogramCode histogram_code;
83 if (is_using_browser_shared_relros) { 84 if (is_using_browser_shared_relros) {
84 histogram_code = load_at_fixed_address_failed 85 histogram_code = load_at_fixed_address_failed
85 ? LOW_MEMORY_LFA_BACKOFF_USED : LOW_MEMORY_LFA_SUCCESS; 86 ? LOW_MEMORY_LFA_BACKOFF_USED : LOW_MEMORY_LFA_SUCCESS;
86 } else { 87 } else {
87 histogram_code = NORMAL_LRA_SUCCESS; 88 histogram_code = NORMAL_LRA_SUCCESS;
88 } 89 }
89 UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.BrowserStates", 90 UMA_HISTOGRAM_ENUMERATION("ChromiumAndroidLinker.BrowserStates",
90 histogram_code, 91 histogram_code,
91 MAX_BROWSER_HISTOGRAM_CODE); 92 MAX_BROWSER_HISTOGRAM_CODE);
93 UMA_HISTOGRAM_BOOLEAN("ChromiumAndroidLinker.ApkMemoryMappingSupported",
94 apk_memory_mapping_supported);
92 } 95 }
93 96
94 void SetLibraryLoadedHook(LibraryLoadedHook* func) { 97 void SetLibraryLoadedHook(LibraryLoadedHook* func) {
95 g_registration_callback = func; 98 g_registration_callback = func;
96 } 99 }
97 100
98 static void InitCommandLine(JNIEnv* env, jclass clazz, 101 static void InitCommandLine(JNIEnv* env, jclass clazz,
99 jobjectArray init_command_line) { 102 jobjectArray init_command_line) {
100 InitNativeCommandLineFromJavaArray(env, init_command_line); 103 InitNativeCommandLineFromJavaArray(env, init_command_line);
101 } 104 }
(...skipping 26 matching lines...) Expand all
128 jstring GetVersionNumber(JNIEnv* env, jclass clazz) { 131 jstring GetVersionNumber(JNIEnv* env, jclass clazz) {
129 return ConvertUTF8ToJavaString(env, g_library_version_number).Release(); 132 return ConvertUTF8ToJavaString(env, g_library_version_number).Release();
130 } 133 }
131 134
132 static void RecordNativeLibraryHack(JNIEnv*, jclass, jboolean usedHack) { 135 static void RecordNativeLibraryHack(JNIEnv*, jclass, jboolean usedHack) {
133 UMA_HISTOGRAM_BOOLEAN("LibraryLoader.NativeLibraryHack", usedHack); 136 UMA_HISTOGRAM_BOOLEAN("LibraryLoader.NativeLibraryHack", usedHack);
134 } 137 }
135 138
136 } // namespace android 139 } // namespace android
137 } // namespace base 140 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698