OLD | NEW |
---|---|
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_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "components/metrics/metrics_log_uploader.h" | |
12 #include "components/metrics/proto/system_profile.pb.h" | 14 #include "components/metrics/proto/system_profile.pb.h" |
13 | 15 |
14 namespace metrics { | 16 namespace metrics { |
15 | 17 |
16 // An abstraction of operations that depend on the embedder's (e.g. Chrome) | 18 // An abstraction of operations that depend on the embedder's (e.g. Chrome) |
17 // environment. | 19 // environment. |
18 class MetricsServiceClient { | 20 class MetricsServiceClient { |
19 public: | 21 public: |
20 virtual ~MetricsServiceClient() {} | 22 virtual ~MetricsServiceClient() {} |
21 | 23 |
(...skipping 21 matching lines...) Expand all Loading... | |
43 virtual void OnLogUploadComplete() = 0; | 45 virtual void OnLogUploadComplete() = 0; |
44 | 46 |
45 // Starts gathering metrics, calling |done_callback| when initial metrics | 47 // Starts gathering metrics, calling |done_callback| when initial metrics |
46 // gathering is complete. | 48 // gathering is complete. |
47 virtual void StartGatheringMetrics(const base::Closure& done_callback) = 0; | 49 virtual void StartGatheringMetrics(const base::Closure& done_callback) = 0; |
48 | 50 |
49 // Called prior to a metrics log being closed, allowing the client to collect | 51 // Called prior to a metrics log being closed, allowing the client to collect |
50 // extra histograms that will go in that log. Asynchronous API - the client | 52 // extra histograms that will go in that log. Asynchronous API - the client |
51 // implementation should call |done_callback| when complete. | 53 // implementation should call |done_callback| when complete. |
52 virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0; | 54 virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0; |
55 | |
56 // Creates a MetricsLogUploader for uploading to the specified |server_url| | |
57 // with the given |mime_type|. When a log upload is finished, the uploader | |
58 // will call |on_upload_complete| with the response code or with -1 on an | |
59 // error. | |
60 virtual scoped_ptr<MetricsLogUploader> CreateUploader( | |
61 const std::string& server_url, | |
62 const std::string& mime_type, | |
63 const base::Callback<void(int)> on_upload_complete) = 0; | |
blundell
2014/05/26 07:56:56
It seems like all these parameters belong as const
Alexei Svitkine (slow)
2014/05/26 20:04:10
Just to clarify, do you mean changing MetricsLogUp
blundell
2014/05/26 20:22:15
I was actually just suggesting adding them as para
Alexei Svitkine (slow)
2014/05/27 14:36:40
Done. I've now added those params/ivars to the bas
| |
53 }; | 64 }; |
54 | 65 |
55 } // namespace metrics | 66 } // namespace metrics |
56 | 67 |
57 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 68 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |