| Index: chrome/browser/android/metrics/uma_session_stats.cc
|
| diff --git a/chrome/browser/android/metrics/uma_session_stats.cc b/chrome/browser/android/metrics/uma_session_stats.cc
|
| index 9be1c0147a733e6b7c6cf810d294f3e4c77eb0a3..8d212479ca6a907e9065099f372dd5524d1cfcb7 100644
|
| --- a/chrome/browser/android/metrics/uma_session_stats.cc
|
| +++ b/chrome/browser/android/metrics/uma_session_stats.cc
|
| @@ -92,8 +92,10 @@ void UmaSessionStats::RegisterSyntheticFieldTrial(
|
| // This happens when we've got permission to upload on Wi-Fi but we're on a
|
| // mobile connection (for example).
|
| // * Logs are neither being recorded or uploaded.
|
| -static void UpdateMetricsServiceState(JNIEnv* env, jobject obj,
|
| - jboolean may_record, jboolean may_upload) {
|
| +static void UpdateMetricsServiceState(JNIEnv* env,
|
| + const JavaParamRef<jobject>& obj,
|
| + jboolean may_record,
|
| + jboolean may_upload) {
|
| metrics::MetricsService* metrics = g_browser_process->metrics_service();
|
| DCHECK(metrics);
|
|
|
| @@ -112,7 +114,9 @@ static void UpdateMetricsServiceState(JNIEnv* env, jobject obj,
|
| }
|
|
|
| // Renderer process crashed in the foreground.
|
| -static void LogRendererCrash(JNIEnv* env, jclass clazz, jboolean is_paused) {
|
| +static void LogRendererCrash(JNIEnv* env,
|
| + const JavaParamRef<jclass>& clazz,
|
| + jboolean is_paused) {
|
| DCHECK(g_browser_process);
|
|
|
| if (!is_paused) {
|
| @@ -129,7 +133,7 @@ static void LogRendererCrash(JNIEnv* env, jclass clazz, jboolean is_paused) {
|
| }
|
|
|
| static void RegisterExternalExperiment(JNIEnv* env,
|
| - jclass clazz,
|
| + const JavaParamRef<jclass>& clazz,
|
| jint study_id,
|
| jint experiment_id) {
|
| const std::string group_name_utf8 = base::IntToString(experiment_id);
|
| @@ -145,16 +149,18 @@ static void RegisterExternalExperiment(JNIEnv* env,
|
| static_cast<uint32_t>(study_id), group_name_utf8);
|
| }
|
|
|
| -static void RegisterSyntheticFieldTrial(JNIEnv* env,
|
| - jclass clazz,
|
| - jstring jtrial_name,
|
| - jstring jgroup_name) {
|
| +static void RegisterSyntheticFieldTrial(
|
| + JNIEnv* env,
|
| + const JavaParamRef<jclass>& clazz,
|
| + const JavaParamRef<jstring>& jtrial_name,
|
| + const JavaParamRef<jstring>& jgroup_name) {
|
| std::string trial_name(ConvertJavaStringToUTF8(env, jtrial_name));
|
| std::string group_name(ConvertJavaStringToUTF8(env, jgroup_name));
|
| UmaSessionStats::RegisterSyntheticFieldTrial(trial_name, group_name);
|
| }
|
|
|
| -static void RecordMultiWindowSession(JNIEnv*, jclass,
|
| +static void RecordMultiWindowSession(JNIEnv*,
|
| + const JavaParamRef<jclass>&,
|
| jint area_percent,
|
| jint instance_count) {
|
| UMA_HISTOGRAM_PERCENTAGE("MobileStartup.MobileMultiWindowSession",
|
| @@ -168,12 +174,16 @@ static void RecordMultiWindowSession(JNIEnv*, jclass,
|
| 10 /* bucket count */);
|
| }
|
|
|
| -static void RecordTabCountPerLoad(JNIEnv*, jclass, jint num_tabs) {
|
| +static void RecordTabCountPerLoad(JNIEnv*,
|
| + const JavaParamRef<jclass>&,
|
| + jint num_tabs) {
|
| // Record how many tabs total are open.
|
| UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.TabCountPerLoad", num_tabs, 1, 200, 50);
|
| }
|
|
|
| -static void RecordPageLoaded(JNIEnv*, jclass, jboolean is_desktop_user_agent) {
|
| +static void RecordPageLoaded(JNIEnv*,
|
| + const JavaParamRef<jclass>&,
|
| + jboolean is_desktop_user_agent) {
|
| // Should be called whenever a page has been loaded.
|
| content::RecordAction(UserMetricsAction("MobilePageLoaded"));
|
| if (is_desktop_user_agent) {
|
| @@ -182,11 +192,11 @@ static void RecordPageLoaded(JNIEnv*, jclass, jboolean is_desktop_user_agent) {
|
| }
|
| }
|
|
|
| -static void RecordPageLoadedWithKeyboard(JNIEnv*, jclass) {
|
| +static void RecordPageLoadedWithKeyboard(JNIEnv*, const JavaParamRef<jclass>&) {
|
| content::RecordAction(UserMetricsAction("MobilePageLoadedWithKeyboard"));
|
| }
|
|
|
| -static jlong Init(JNIEnv* env, jclass obj) {
|
| +static jlong Init(JNIEnv* env, const JavaParamRef<jclass>& obj) {
|
| // We should have only one UmaSessionStats instance.
|
| DCHECK(!g_uma_session_stats);
|
| g_uma_session_stats = new UmaSessionStats();
|
|
|