| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/android/metrics/uma_session_stats.h" | 5 #include "chrome/browser/android/metrics/uma_session_stats.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 pref->SetInteger(metrics::prefs::kStabilityRendererCrashCount, value + 1); | 126 pref->SetInteger(metrics::prefs::kStabilityRendererCrashCount, value + 1); |
| 127 } | 127 } |
| 128 | 128 |
| 129 static void RegisterExternalExperiment(JNIEnv* env, | 129 static void RegisterExternalExperiment(JNIEnv* env, |
| 130 const JavaParamRef<jclass>& clazz, | 130 const JavaParamRef<jclass>& clazz, |
| 131 jint study_id, | 131 jint study_id, |
| 132 jint experiment_id) { | 132 jint experiment_id) { |
| 133 const std::string group_name_utf8 = base::IntToString(experiment_id); | 133 const std::string group_name_utf8 = base::IntToString(experiment_id); |
| 134 | 134 |
| 135 variations::ActiveGroupId active_group; | 135 variations::ActiveGroupId active_group; |
| 136 active_group.name = static_cast<uint32>(study_id); | 136 active_group.name = static_cast<uint32_t>(study_id); |
| 137 active_group.group = metrics::HashName(group_name_utf8); | 137 active_group.group = metrics::HashName(group_name_utf8); |
| 138 variations::AssociateGoogleVariationIDForceHashes( | 138 variations::AssociateGoogleVariationIDForceHashes( |
| 139 variations::GOOGLE_WEB_PROPERTIES, active_group, | 139 variations::GOOGLE_WEB_PROPERTIES, active_group, |
| 140 static_cast<variations::VariationID>(experiment_id)); | 140 static_cast<variations::VariationID>(experiment_id)); |
| 141 | 141 |
| 142 UmaSessionStats::RegisterSyntheticFieldTrialWithNameHash( | 142 UmaSessionStats::RegisterSyntheticFieldTrialWithNameHash( |
| 143 static_cast<uint32_t>(study_id), group_name_utf8); | 143 static_cast<uint32_t>(study_id), group_name_utf8); |
| 144 } | 144 } |
| 145 | 145 |
| 146 static void RegisterSyntheticFieldTrial( | 146 static void RegisterSyntheticFieldTrial( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // We should have only one UmaSessionStats instance. | 194 // We should have only one UmaSessionStats instance. |
| 195 DCHECK(!g_uma_session_stats); | 195 DCHECK(!g_uma_session_stats); |
| 196 g_uma_session_stats = new UmaSessionStats(); | 196 g_uma_session_stats = new UmaSessionStats(); |
| 197 return reinterpret_cast<intptr_t>(g_uma_session_stats); | 197 return reinterpret_cast<intptr_t>(g_uma_session_stats); |
| 198 } | 198 } |
| 199 | 199 |
| 200 // Register native methods | 200 // Register native methods |
| 201 bool RegisterUmaSessionStats(JNIEnv* env) { | 201 bool RegisterUmaSessionStats(JNIEnv* env) { |
| 202 return RegisterNativesImpl(env); | 202 return RegisterNativesImpl(env); |
| 203 } | 203 } |
| OLD | NEW |