| 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" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string16.h" |
| 13 #include "components/metrics/proto/system_profile.pb.h" | 14 #include "components/metrics/proto/system_profile.pb.h" |
| 14 | 15 |
| 15 namespace metrics { | 16 namespace metrics { |
| 16 | 17 |
| 17 class MetricsLogUploader; | 18 class MetricsLogUploader; |
| 18 | 19 |
| 19 // An abstraction of operations that depend on the embedder's (e.g. Chrome) | 20 // An abstraction of operations that depend on the embedder's (e.g. Chrome) |
| 20 // environment. | 21 // environment. |
| 21 class MetricsServiceClient { | 22 class MetricsServiceClient { |
| 22 public: | 23 public: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 53 // extra histograms that will go in that log. Asynchronous API - the client | 54 // extra histograms that will go in that log. Asynchronous API - the client |
| 54 // implementation should call |done_callback| when complete. | 55 // implementation should call |done_callback| when complete. |
| 55 virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0; | 56 virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0; |
| 56 | 57 |
| 57 // Creates a MetricsLogUploader with the specified parameters (see comments on | 58 // Creates a MetricsLogUploader with the specified parameters (see comments on |
| 58 // MetricsLogUploader for details). | 59 // MetricsLogUploader for details). |
| 59 virtual scoped_ptr<MetricsLogUploader> CreateUploader( | 60 virtual scoped_ptr<MetricsLogUploader> CreateUploader( |
| 60 const std::string& server_url, | 61 const std::string& server_url, |
| 61 const std::string& mime_type, | 62 const std::string& mime_type, |
| 62 const base::Callback<void(int)>& on_upload_complete) = 0; | 63 const base::Callback<void(int)>& on_upload_complete) = 0; |
| 64 |
| 65 #if defined(OS_WIN) |
| 66 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store |
| 67 // backups of metrics data. |
| 68 virtual base::string16 GetRegistryBackupKey() = 0; |
| 69 #endif |
| 63 }; | 70 }; |
| 64 | 71 |
| 65 } // namespace metrics | 72 } // namespace metrics |
| 66 | 73 |
| 67 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 74 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |