| 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 27 matching lines...) Expand all Loading... |
| 38 virtual void QueueReport(const std::string& data); | 38 virtual void QueueReport(const std::string& data); |
| 39 | 39 |
| 40 base::FilePath GetFeedbackReportsPath() { return report_path_; } | 40 base::FilePath GetFeedbackReportsPath() { return report_path_; } |
| 41 | 41 |
| 42 bool QueueEmpty() const { return reports_queue_.empty(); } | 42 bool QueueEmpty() const { return reports_queue_.empty(); } |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 friend class FeedbackUploaderTest; | 45 friend class FeedbackUploaderTest; |
| 46 | 46 |
| 47 struct ReportsUploadTimeComparator { | 47 struct ReportsUploadTimeComparator { |
| 48 bool operator()(FeedbackReport* a, FeedbackReport* b) const; | 48 bool operator()(const scoped_refptr<FeedbackReport>& a, |
| 49 const scoped_refptr<FeedbackReport>& b) const; |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 void Init(); | 52 void Init(); |
| 52 | 53 |
| 53 // Dispatches the report to be uploaded. | 54 // Dispatches the report to be uploaded. |
| 54 virtual void DispatchReport(const std::string& data) = 0; | 55 virtual void DispatchReport(const std::string& data) = 0; |
| 55 | 56 |
| 56 // Update our timer for uploading the next report. | 57 // Update our timer for uploading the next report. |
| 57 void UpdateUploadTimer(); | 58 void UpdateUploadTimer(); |
| 58 | 59 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 77 base::TimeDelta retry_delay_; | 78 base::TimeDelta retry_delay_; |
| 78 std::string url_; | 79 std::string url_; |
| 79 base::SequencedWorkerPool* pool_; | 80 base::SequencedWorkerPool* pool_; |
| 80 | 81 |
| 81 DISALLOW_COPY_AND_ASSIGN(FeedbackUploader); | 82 DISALLOW_COPY_AND_ASSIGN(FeedbackUploader); |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 } // namespace feedback | 85 } // namespace feedback |
| 85 | 86 |
| 86 #endif // COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_H_ | 87 #endif // COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_H_ |
| OLD | NEW |