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

Side by Side Diff: components/cronet/histogram_manager.h

Issue 1075503002: Move histogram_manager from components/metrics to components/cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Raman's comments Created 5 years, 8 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 | « components/cronet/cronet_static.gypi ('k') | components/cronet/histogram_manager.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 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef COMPONENTS_METRICS_HISTOGRAM_MANAGER_H_ 5 #ifndef COMPONENTS_CRONET_HISTOGRAM_MANAGER_H_
6 #define COMPONENTS_METRICS_HISTOGRAM_MANAGER_H_ 6 #define COMPONENTS_CRONET_HISTOGRAM_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/metrics/histogram_flattener.h" 15 #include "base/metrics/histogram_flattener.h"
16 #include "base/metrics/histogram_snapshot_manager.h" 16 #include "base/metrics/histogram_snapshot_manager.h"
17 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" 17 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h"
18 18
19 namespace metrics { 19 namespace cronet {
20 20
21 // TODO(mef): crbug.com/441441. Move components/metrics/histogram_manager.* 21 // A HistogramManager instance is created by the app. It is the central
22 // files into components/android/cronet. 22 // controller for the acquisition of log data, and recording deltas for
23 // 23 // transmission to an external server.
24 // A HistogramManager instance is created by Android. It is the central
25 // controller for the acquisition of log data, and the automatic transmission of
26 // that log data to an external server.
27 class HistogramManager : public base::HistogramFlattener { 24 class HistogramManager : public base::HistogramFlattener {
28 public: 25 public:
29 HistogramManager(); 26 HistogramManager();
30 ~HistogramManager() override; 27 ~HistogramManager() override;
31 28
32 // Snapshot all histograms to record the delta into |uma_proto_| and then 29 // Snapshot all histograms to record the delta into |uma_proto_| and then
33 // returns the serialized protobuf representation of the record in |data|. 30 // returns the serialized protobuf representation of the record in |data|.
34 // Returns true if it was successfully serialized. 31 // Returns true if it was successfully serialized.
35 bool GetDeltas(std::vector<uint8>* data); 32 bool GetDeltas(std::vector<uint8>* data);
36 33
(...skipping 13 matching lines...) Expand all
50 void InconsistencyDetectedInLoggedCount(int amount) override; 47 void InconsistencyDetectedInLoggedCount(int amount) override;
51 48
52 base::HistogramSnapshotManager histogram_snapshot_manager_; 49 base::HistogramSnapshotManager histogram_snapshot_manager_;
53 50
54 // Stores the protocol buffer representation for this log. 51 // Stores the protocol buffer representation for this log.
55 metrics::ChromeUserMetricsExtension uma_proto_; 52 metrics::ChromeUserMetricsExtension uma_proto_;
56 53
57 DISALLOW_COPY_AND_ASSIGN(HistogramManager); 54 DISALLOW_COPY_AND_ASSIGN(HistogramManager);
58 }; 55 };
59 56
60 } // namespace metrics 57 } // namespace cronet
61 58
62 #endif // COMPONENTS_METRICS_HISTOGRAM_MANAGER_H_ 59 #endif // COMPONENTS_CRONET_HISTOGRAM_MANAGER_H_
OLDNEW
« no previous file with comments | « components/cronet/cronet_static.gypi ('k') | components/cronet/histogram_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698