| 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 #include "components/feedback/feedback_uploader.h" | 5 #include "components/feedback/feedback_uploader.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/callback.h" | 9 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 10 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 11 #include "base/task_runner_util.h" | 13 #include "base/task_runner_util.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "components/feedback/feedback_report.h" | 15 #include "components/feedback/feedback_report.h" |
| 14 | 16 |
| 15 namespace feedback { | 17 namespace feedback { |
| 16 namespace { | 18 namespace { |
| 17 | 19 |
| 18 const char kFeedbackPostUrl[] = | 20 const char kFeedbackPostUrl[] = |
| 19 "https://www.google.com/tools/feedback/chrome/__submit"; | 21 "https://www.google.com/tools/feedback/chrome/__submit"; |
| 20 | 22 |
| 21 const int64 kRetryDelayMinutes = 60; | 23 const int64_t kRetryDelayMinutes = 60; |
| 22 | 24 |
| 23 const base::FilePath::CharType kFeedbackReportPath[] = | 25 const base::FilePath::CharType kFeedbackReportPath[] = |
| 24 FILE_PATH_LITERAL("Feedback Reports"); | 26 FILE_PATH_LITERAL("Feedback Reports"); |
| 25 | 27 |
| 26 } // namespace | 28 } // namespace |
| 27 | 29 |
| 28 bool FeedbackUploader::ReportsUploadTimeComparator::operator()( | 30 bool FeedbackUploader::ReportsUploadTimeComparator::operator()( |
| 29 const scoped_refptr<FeedbackReport>& a, | 31 const scoped_refptr<FeedbackReport>& a, |
| 30 const scoped_refptr<FeedbackReport>& b) const { | 32 const scoped_refptr<FeedbackReport>& b) const { |
| 31 return a->upload_at() > b->upload_at(); | 33 return a->upload_at() > b->upload_at(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 104 } |
| 103 | 105 |
| 104 void FeedbackUploader::setup_for_test( | 106 void FeedbackUploader::setup_for_test( |
| 105 const ReportDataCallback& dispatch_callback, | 107 const ReportDataCallback& dispatch_callback, |
| 106 const base::TimeDelta& retry_delay) { | 108 const base::TimeDelta& retry_delay) { |
| 107 dispatch_callback_ = dispatch_callback; | 109 dispatch_callback_ = dispatch_callback; |
| 108 retry_delay_ = retry_delay; | 110 retry_delay_ = retry_delay; |
| 109 } | 111 } |
| 110 | 112 |
| 111 } // namespace feedback | 113 } // namespace feedback |
| OLD | NEW |