OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "components/metrics/test_metrics_log_uploader.h" | 5 #include "components/metrics/test_metrics_log_uploader.h" |
| 6 #include "components/metrics/metrics_log_uploader.h" |
6 | 7 |
7 namespace metrics { | 8 namespace metrics { |
8 | 9 |
9 TestMetricsLogUploader::TestMetricsLogUploader( | 10 TestMetricsLogUploader::TestMetricsLogUploader( |
10 const std::string& server_url, | 11 const std::string& server_url, |
11 const std::string& mime_type, | 12 const std::string& mime_type, |
| 13 MetricsLogUploader::MetricServiceType service_type, |
12 const base::Callback<void(int)>& on_upload_complete) | 14 const base::Callback<void(int)>& on_upload_complete) |
13 : MetricsLogUploader(server_url, mime_type, on_upload_complete), | 15 : MetricsLogUploader(server_url, |
| 16 mime_type, |
| 17 service_type, |
| 18 on_upload_complete), |
14 is_uploading_(false) {} | 19 is_uploading_(false) {} |
15 | 20 |
16 TestMetricsLogUploader::~TestMetricsLogUploader() = default; | 21 TestMetricsLogUploader::~TestMetricsLogUploader() = default; |
17 | 22 |
18 void TestMetricsLogUploader::CompleteUpload(int response_code) { | 23 void TestMetricsLogUploader::CompleteUpload(int response_code) { |
19 DCHECK(is_uploading_); | 24 DCHECK(is_uploading_); |
20 is_uploading_ = false; | 25 is_uploading_ = false; |
21 on_upload_complete_.Run(response_code); | 26 on_upload_complete_.Run(response_code); |
22 } | 27 } |
23 | 28 |
24 void TestMetricsLogUploader::UploadLog(const std::string& compressed_log_data, | 29 void TestMetricsLogUploader::UploadLog(const std::string& compressed_log_data, |
25 const std::string& log_hash) { | 30 const std::string& log_hash) { |
26 DCHECK(!is_uploading_); | 31 DCHECK(!is_uploading_); |
27 is_uploading_ = true; | 32 is_uploading_ = true; |
28 } | 33 } |
29 | 34 |
30 } // namespace metrics | 35 } // namespace metrics |
OLD | NEW |