| 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 #include "components/metrics/metrics_log_uploader.h" |
| 7 | 7 |
| 8 namespace metrics { | 8 namespace metrics { |
| 9 | 9 |
| 10 TestMetricsLogUploader::TestMetricsLogUploader( | 10 TestMetricsLogUploader::TestMetricsLogUploader( |
| 11 const base::Callback<void(int)>& on_upload_complete) | 11 const MetricsLogUploader::UploadCallback& on_upload_complete) |
| 12 : on_upload_complete_(on_upload_complete), is_uploading_(false) {} | 12 : on_upload_complete_(on_upload_complete), is_uploading_(false) {} |
| 13 | 13 |
| 14 TestMetricsLogUploader::~TestMetricsLogUploader() = default; | 14 TestMetricsLogUploader::~TestMetricsLogUploader() = default; |
| 15 | 15 |
| 16 void TestMetricsLogUploader::CompleteUpload(int response_code) { | 16 void TestMetricsLogUploader::CompleteUpload(int response_code) { |
| 17 DCHECK(is_uploading_); | 17 DCHECK(is_uploading_); |
| 18 is_uploading_ = false; | 18 is_uploading_ = false; |
| 19 on_upload_complete_.Run(response_code); | 19 on_upload_complete_.Run(response_code, 0); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void TestMetricsLogUploader::UploadLog(const std::string& compressed_log_data, | 22 void TestMetricsLogUploader::UploadLog(const std::string& compressed_log_data, |
| 23 const std::string& log_hash) { | 23 const std::string& log_hash) { |
| 24 DCHECK(!is_uploading_); | 24 DCHECK(!is_uploading_); |
| 25 is_uploading_ = true; | 25 is_uploading_ = true; |
| 26 } | 26 } |
| 27 | 27 |
| 28 } // namespace metrics | 28 } // namespace metrics |
| OLD | NEW |