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

Unified Diff: components/cronet/android/histogram_manager.h

Issue 794493002: Add UMA Histogram Manager to Cronet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved histogram_manager_unittest to components/metrics Created 6 years 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: components/cronet/android/histogram_manager.h
diff --git a/components/cronet/android/histogram_manager.h b/components/cronet/android/histogram_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..ca5eb62ea964ed0f42531a9563ec74281efb91a5
--- /dev/null
+++ b/components/cronet/android/histogram_manager.h
@@ -0,0 +1,36 @@
+// Copyright 2014 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 COMPONENTS_CRONET_ANDROID_CRONET_HISTOGRAM_MANAGER_H_
+#define COMPONENTS_CRONET_ANDROID_CRONET_HISTOGRAM_MANAGER_H_
+
+#include <jni.h>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/macros.h"
+
+namespace cronet {
+
+bool HistogramManagerRegisterJni(JNIEnv* env);
+
+// A HistogramManager instance is created by Android. It is the central
+// controller for the acquisition of log data, and the automatic transmission of
+// that log data to an external server.
+class HistogramManager {
Alexei Svitkine (slow) 2014/12/11 20:09:09 Remove? Since its in the metrics component now?
ramant (doing other things) 2014/12/11 20:23:53 Haven't tested this code on cronet. Added GetHist
+ public:
+ HistogramManager();
+ ~HistogramManager();
+
+ // Snapshot all histograms to record the delta into |uma_proto_| and then
+ // returns the serialized protobuf representation of the record.
+ std::vector<uint8> GetDeltas();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HistogramManager);
+};
+
+} // namespace cronet
+
+#endif // COMPONENTS_CRONET_ANDROID_CRONET_HISTOGRAM_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698