Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Side by Side Diff: components/metrics/test_metrics_log_uploader.h

Issue 2735443003: Use StringPiece for CreateUploader/NetMetricsLogUploader params. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ 5 #ifndef COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_
6 #define COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ 6 #define COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_
7 7
8 #include "components/metrics/metrics_log_uploader.h" 8 #include "components/metrics/metrics_log_uploader.h"
9 9
10 namespace metrics { 10 namespace metrics {
11 11
12 class TestMetricsLogUploader : public MetricsLogUploader { 12 class TestMetricsLogUploader : public MetricsLogUploader {
13 public: 13 public:
14 TestMetricsLogUploader(const std::string& server_url, 14 TestMetricsLogUploader(const base::Callback<void(int)>& on_upload_complete);
Alexei Svitkine (slow) 2017/03/06 21:07:46 explicit
Steven Holte 2017/03/06 21:22:11 Done.
15 const std::string& mime_type, 15 ~TestMetricsLogUploader();
16 MetricsLogUploader::MetricServiceType service_type,
17 const base::Callback<void(int)>& on_upload_complete);
18 ~TestMetricsLogUploader() override;
19 16
20 // Mark the current upload complete with the given response code. 17 // Mark the current upload complete with the given response code.
21 void CompleteUpload(int response_code); 18 void CompleteUpload(int response_code);
22 19
23 // Check if UploadLog has been called. 20 // Check if UploadLog has been called.
24 bool is_uploading() const { return is_uploading_; } 21 bool is_uploading() const { return is_uploading_; }
25 22
26 private: 23 private:
27 // MetricsLogUploader: 24 // MetricsLogUploader:
28 void UploadLog(const std::string& compressed_log_data, 25 void UploadLog(const std::string& compressed_log_data,
29 const std::string& log_hash) override; 26 const std::string& log_hash) override;
30 27
28 const base::Callback<void(int)> on_upload_complete_;
31 bool is_uploading_; 29 bool is_uploading_;
32 30
33 DISALLOW_COPY_AND_ASSIGN(TestMetricsLogUploader); 31 DISALLOW_COPY_AND_ASSIGN(TestMetricsLogUploader);
34 }; 32 };
35 33
36 } // namespace metrics 34 } // namespace metrics
37 35
38 #endif // COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ 36 #endif // COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698