OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 CHROME_BROWSER_METRICS_DISK_METRICS_PROVIDER_H_ | |
Alexei Svitkine (slow)
2015/03/12 16:41:06
Can this class live in the component? Since it jus
Dan Beam
2015/03/13 19:31:32
look at the cc dependencies
| |
6 #define CHROME_BROWSER_METRICS_DISK_METRICS_PROVIDER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/weak_ptr.h" | |
10 #include "base/threading/thread_checker.h" | |
11 #include "components/metrics/metrics_provider.h" | |
12 | |
13 struct SeekPenaltyResponse { | |
14 SeekPenaltyResponse(); | |
15 bool success; | |
16 bool has_seek_penalty; | |
17 }; | |
18 | |
19 struct DiskMetrics { | |
Alexei Svitkine (slow)
2015/03/12 16:41:06
Can these be declared inside the class? That way,
Dan Beam
2015/03/13 19:31:32
yes, Done.
| |
20 SeekPenaltyResponse app_disk; | |
21 SeekPenaltyResponse user_data_disk; | |
22 }; | |
23 | |
24 // Provides metrics about the local disks on a user's computer. Currently only | |
25 // checks to see if they incur a seek-time penalty (e.g. if they're SSDs). | |
26 class DiskMetricsProvider : public metrics::MetricsProvider { | |
27 public: | |
28 DiskMetricsProvider(); | |
29 ~DiskMetricsProvider() override; | |
30 | |
31 // metrics::MetricsDataProvider: | |
32 void ProvideSystemProfileMetrics( | |
33 metrics::SystemProfileProto* system_profile_proto) override; | |
34 | |
35 private: | |
36 void GotDiskMetrics(const DiskMetrics& metrics); | |
Alexei Svitkine (slow)
2015/03/12 16:41:06
Add a comment.
Dan Beam
2015/03/13 19:31:32
Done.
| |
37 | |
38 DiskMetrics metrics_; | |
39 | |
40 base::ThreadChecker thread_checker_; | |
41 base::WeakPtrFactory<DiskMetricsProvider> weak_ptr_factory_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(DiskMetricsProvider); | |
44 }; | |
45 | |
46 #endif // CHROME_BROWSER_METRICS_DISK_METRICS_PROVIDER_H_ | |
OLD | NEW |