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

Side by Side Diff: chrome/browser/android/metrics/uma_session_stats.cc

Issue 1366643002: Extract guts of ChromeStabilityMetricsProvider into helper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « no previous file | chrome/browser/memory/system_memory_stats_recorder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 g_browser_process->GetMetricsServicesManager()->UpdatePermissions( 112 g_browser_process->GetMetricsServicesManager()->UpdatePermissions(
113 may_record, may_upload); 113 may_record, may_upload);
114 } 114 }
115 115
116 // Renderer process crashed in the foreground. 116 // Renderer process crashed in the foreground.
117 static void LogRendererCrash(JNIEnv*, const JavaParamRef<jclass>&) { 117 static void LogRendererCrash(JNIEnv*, const JavaParamRef<jclass>&) {
118 DCHECK(g_browser_process); 118 DCHECK(g_browser_process);
119 // Increment the renderer crash count in stability metrics. 119 // Increment the renderer crash count in stability metrics.
120 PrefService* pref = g_browser_process->local_state(); 120 PrefService* pref = g_browser_process->local_state();
121 DCHECK(pref); 121 DCHECK(pref);
122 int value = pref->GetInteger(prefs::kStabilityRendererCrashCount); 122 int value = pref->GetInteger(metrics::prefs::kStabilityRendererCrashCount);
123 pref->SetInteger(prefs::kStabilityRendererCrashCount, value + 1); 123 pref->SetInteger(metrics::prefs::kStabilityRendererCrashCount, value + 1);
124 } 124 }
125 125
126 static void RegisterExternalExperiment(JNIEnv* env, 126 static void RegisterExternalExperiment(JNIEnv* env,
127 const JavaParamRef<jclass>& clazz, 127 const JavaParamRef<jclass>& clazz,
128 jint study_id, 128 jint study_id,
129 jint experiment_id) { 129 jint experiment_id) {
130 const std::string group_name_utf8 = base::IntToString(experiment_id); 130 const std::string group_name_utf8 = base::IntToString(experiment_id);
131 131
132 variations::ActiveGroupId active_group; 132 variations::ActiveGroupId active_group;
133 active_group.name = static_cast<uint32>(study_id); 133 active_group.name = static_cast<uint32>(study_id);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // We should have only one UmaSessionStats instance. 191 // We should have only one UmaSessionStats instance.
192 DCHECK(!g_uma_session_stats); 192 DCHECK(!g_uma_session_stats);
193 g_uma_session_stats = new UmaSessionStats(); 193 g_uma_session_stats = new UmaSessionStats();
194 return reinterpret_cast<intptr_t>(g_uma_session_stats); 194 return reinterpret_cast<intptr_t>(g_uma_session_stats);
195 } 195 }
196 196
197 // Register native methods 197 // Register native methods
198 bool RegisterUmaSessionStats(JNIEnv* env) { 198 bool RegisterUmaSessionStats(JNIEnv* env) {
199 return RegisterNativesImpl(env); 199 return RegisterNativesImpl(env);
200 } 200 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/memory/system_memory_stats_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698