| 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_FEEDBACK_FEEDBACK_UPLOADER_H_ | 5 #ifndef COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_H_ |
| 6 #define COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_H_ | 6 #define COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Requeue this report with a delay. | 60 // Requeue this report with a delay. |
| 61 void RetryReport(const std::string& data); | 61 void RetryReport(const std::string& data); |
| 62 | 62 |
| 63 void QueueReportWithDelay(const std::string& data, base::TimeDelta delay); | 63 void QueueReportWithDelay(const std::string& data, base::TimeDelta delay); |
| 64 | 64 |
| 65 void setup_for_test(const ReportDataCallback& dispatch_callback, | 65 void setup_for_test(const ReportDataCallback& dispatch_callback, |
| 66 const base::TimeDelta& retry_delay); | 66 const base::TimeDelta& retry_delay); |
| 67 | 67 |
| 68 base::FilePath report_path_; | 68 base::FilePath report_path_; |
| 69 // Timer to upload the next report at. | 69 // Timer to upload the next report at. |
| 70 base::OneShotTimer<FeedbackUploader> upload_timer_; | 70 base::OneShotTimer upload_timer_; |
| 71 // Priority queue of reports prioritized by the time the report is supposed | 71 // Priority queue of reports prioritized by the time the report is supposed |
| 72 // to be uploaded at. | 72 // to be uploaded at. |
| 73 std::priority_queue<scoped_refptr<FeedbackReport>, | 73 std::priority_queue<scoped_refptr<FeedbackReport>, |
| 74 std::vector<scoped_refptr<FeedbackReport> >, | 74 std::vector<scoped_refptr<FeedbackReport> >, |
| 75 ReportsUploadTimeComparator> reports_queue_; | 75 ReportsUploadTimeComparator> reports_queue_; |
| 76 | 76 |
| 77 ReportDataCallback dispatch_callback_; | 77 ReportDataCallback dispatch_callback_; |
| 78 base::TimeDelta retry_delay_; | 78 base::TimeDelta retry_delay_; |
| 79 std::string url_; | 79 std::string url_; |
| 80 base::SequencedWorkerPool* pool_; | 80 base::SequencedWorkerPool* pool_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(FeedbackUploader); | 82 DISALLOW_COPY_AND_ASSIGN(FeedbackUploader); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace feedback | 85 } // namespace feedback |
| 86 | 86 |
| 87 #endif // COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_H_ | 87 #endif // COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_H_ |
| OLD | NEW |