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

Unified Diff: chrome/browser/android/uma_session_stats.h

Issue 962293002: Upstream UmaSessionStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/uma_session_stats.h
diff --git a/chrome/browser/android/uma_session_stats.h b/chrome/browser/android/uma_session_stats.h
new file mode 100644
index 0000000000000000000000000000000000000000..bcaadea1465fb5825074c06b3da933c6b55f073d
--- /dev/null
+++ b/chrome/browser/android/uma_session_stats.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_UMA_SESSION_STATS_H_
+#define CHROME_BROWSER_ANDROID_UMA_SESSION_STATS_H_
+
+#include <jni.h>
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "base/time/time.h"
+
+class UserActionRateCounter;
+
+// The native part of java UmaSessionStats class.
+class UmaSessionStats {
+ public:
+ UmaSessionStats();
+
+ void UmaResumeSession(JNIEnv* env, jobject obj);
+ void UmaEndSession(JNIEnv* env, jobject obj);
+
+ static void RegisterSyntheticFieldTrialWithNameHash(
+ uint32_t trial_name_hash,
+ const std::string& group_name);
+
+ static void RegisterSyntheticFieldTrial(
+ const std::string& trial_name,
+ const std::string& group_name);
+
+ private:
+ ~UmaSessionStats();
+
+ // Start of the current session, used for UMA.
+ base::TimeTicks session_start_time_;
+ int active_session_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(UmaSessionStats);
+};
+
+// Registers the native methods through jni
+bool RegisterUmaSessionStats(JNIEnv* env);
+
+#endif // CHROME_BROWSER_ANDROID_UMA_SESSION_STATS_H_

Powered by Google App Engine
This is Rietveld 408576698