Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_HISTOGRAM_MANAGER_H_ | |
| 6 #define COMPONENTS_CRONET_ANDROID_CRONET_HISTOGRAM_MANAGER_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/macros.h" | |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" | |
| 16 | |
| 17 namespace base { | |
| 18 class HistogramDeltaSerialization; | |
| 19 class HistogramSamples; | |
| 20 class HistogramSnapshotManager; | |
| 21 }; | |
|
Alexei Svitkine (slow)
2014/12/03 16:46:53
Nit: No need for }
| |
| 22 | |
| 23 namespace cronet { | |
| 24 | |
| 25 bool HistogramManagerRegisterJni(JNIEnv* env); | |
| 26 | |
| 27 class HistogramManager { | |
| 28 public: | |
| 29 HistogramManager(); | |
| 30 ~HistogramManager(); | |
| 31 | |
| 32 void UpdateUmaProto(); | |
|
Alexei Svitkine (slow)
2014/12/03 16:46:53
Please add some comments on the methods and on the
| |
| 33 | |
| 34 std::string SerializeUmaProto(); | |
| 35 | |
| 36 const metrics::ChromeUserMetricsExtension& uma_proto() const { | |
| 37 return uma_proto_; | |
| 38 } | |
| 39 | |
| 40 private: | |
| 41 void RecordHistogramDelta(const std::string& histogram_name, | |
| 42 const base::HistogramSamples& snapshot); | |
| 43 | |
| 44 scoped_ptr<base::HistogramDeltaSerialization> histogram_flattener_; | |
| 45 scoped_ptr<base::HistogramSnapshotManager> histogram_snapshot_manager_; | |
|
Alexei Svitkine (slow)
2014/12/03 16:46:53
I don't think this needs to be a scoped_ptr - can
| |
| 46 | |
| 47 // Stores the protocol buffer representation for this log. | |
| 48 metrics::ChromeUserMetricsExtension uma_proto_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(HistogramManager); | |
| 51 }; | |
| 52 | |
| 53 } // namespace cronet | |
| 54 | |
| 55 #endif // COMPONENTS_CRONET_ANDROID_CRONET_HISTOGRAM_MANAGER_H_ | |
| OLD | NEW |