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

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

Issue 2735443003: Use StringPiece for CreateUploader/NetMetricsLogUploader params. (Closed)
Patch Set: Nit and Rebase 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 explicit TestMetricsLogUploader(
15 const std::string& mime_type, 15 const base::Callback<void(int)>& on_upload_complete);
16 MetricsLogUploader::MetricServiceType service_type,
17 const base::Callback<void(int)>& on_upload_complete);
18 ~TestMetricsLogUploader() override; 16 ~TestMetricsLogUploader() override;
19 17
20 // Mark the current upload complete with the given response code. 18 // Mark the current upload complete with the given response code.
21 void CompleteUpload(int response_code); 19 void CompleteUpload(int response_code);
22 20
23 // Check if UploadLog has been called. 21 // Check if UploadLog has been called.
24 bool is_uploading() const { return is_uploading_; } 22 bool is_uploading() const { return is_uploading_; }
25 23
26 private: 24 private:
27 // MetricsLogUploader: 25 // MetricsLogUploader:
28 void UploadLog(const std::string& compressed_log_data, 26 void UploadLog(const std::string& compressed_log_data,
29 const std::string& log_hash) override; 27 const std::string& log_hash) override;
30 28
29 const base::Callback<void(int)> on_upload_complete_;
31 bool is_uploading_; 30 bool is_uploading_;
32 31
33 DISALLOW_COPY_AND_ASSIGN(TestMetricsLogUploader); 32 DISALLOW_COPY_AND_ASSIGN(TestMetricsLogUploader);
34 }; 33 };
35 34
36 } // namespace metrics 35 } // namespace metrics
37 36
38 #endif // COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_ 37 #endif // COMPONENTS_METRICS_TEST_METRICS_LOG_UPLOADER_H_
OLDNEW
« no previous file with comments | « components/metrics/net/net_metrics_log_uploader.cc ('k') | components/metrics/test_metrics_log_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698