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

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

Issue 2014463003: Modifications for recording whether UMA/Crash default state for iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/first_run/first_run_internal_posix.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_utils.h" 5 #include "chrome/browser/android/metrics/uma_utils.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/metrics/metrics_reporting_state.h" 10 #include "components/metrics/metrics_reporting_default_state.h"
11 #include "jni/UmaUtils_jni.h" 11 #include "jni/UmaUtils_jni.h"
12 12
13 class PrefService; 13 class PrefService;
14 14
15 namespace chrome { 15 namespace chrome {
16 namespace android { 16 namespace android {
17 17
18 base::Time GetMainEntryPointTime() { 18 base::Time GetMainEntryPointTime() {
19 JNIEnv* env = base::android::AttachCurrentThread(); 19 JNIEnv* env = base::android::AttachCurrentThread();
20 int64_t startTimeUnixMs = Java_UmaUtils_getMainEntryPointWallTime(env); 20 int64_t startTimeUnixMs = Java_UmaUtils_getMainEntryPointWallTime(env);
21 return base::Time::UnixEpoch() + 21 return base::Time::UnixEpoch() +
22 base::TimeDelta::FromMilliseconds(startTimeUnixMs); 22 base::TimeDelta::FromMilliseconds(startTimeUnixMs);
23 } 23 }
24 24
25 static void RecordMetricsReportingDefaultOptIn(JNIEnv* env, 25 static void RecordMetricsReportingDefaultOptIn(JNIEnv* env,
26 const JavaParamRef<jclass>& obj, 26 const JavaParamRef<jclass>& obj,
27 jboolean opt_in) { 27 jboolean opt_in) {
28 DCHECK(g_browser_process); 28 DCHECK(g_browser_process);
29 PrefService* local_state = g_browser_process->local_state(); 29 PrefService* local_state = g_browser_process->local_state();
30 ::RecordMetricsReportingDefaultOptIn(local_state, opt_in); 30 metrics::RecordMetricsReportingDefaultOptIn(local_state, opt_in);
31 } 31 }
32 32
33 bool RegisterStartupMetricUtils(JNIEnv* env) { 33 bool RegisterStartupMetricUtils(JNIEnv* env) {
34 return RegisterNativesImpl(env); 34 return RegisterNativesImpl(env);
35 } 35 }
36 36
37 } // namespace android 37 } // namespace android
38 } // namespace chrome 38 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/first_run/first_run_internal_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698