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

Side by Side Diff: components/feedback/feedback_uploader.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 2 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 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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698