OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/safe_browsing/download_feedback_service.h" | 5 #include "chrome/browser/safe_browsing/download_feedback_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 if (service) { | 170 if (service) { |
171 bool is_path_empty = path.empty(); | 171 bool is_path_empty = path.empty(); |
172 UMA_HISTOGRAM_BOOLEAN("SBDownloadFeedback.EmptyFilePathFailure", | 172 UMA_HISTOGRAM_BOOLEAN("SBDownloadFeedback.EmptyFilePathFailure", |
173 is_path_empty); | 173 is_path_empty); |
174 if (is_path_empty) | 174 if (is_path_empty) |
175 return; | 175 return; |
176 service->BeginFeedback(ping_request, ping_response, path); | 176 service->BeginFeedback(ping_request, ping_response, path); |
177 } else { | 177 } else { |
178 file_task_runner->PostTask( | 178 file_task_runner->PostTask( |
179 FROM_HERE, | 179 FROM_HERE, |
180 base::Bind(base::IgnoreResult(&base::DeleteFile), path, false)); | 180 base::BindOnce(base::IgnoreResult(&base::DeleteFile), path, false)); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 void DownloadFeedbackService::StartPendingFeedback() { | 184 void DownloadFeedbackService::StartPendingFeedback() { |
185 DCHECK(!active_feedback_.empty()); | 185 DCHECK(!active_feedback_.empty()); |
186 active_feedback_.front()->Start(base::Bind( | 186 active_feedback_.front()->Start(base::Bind( |
187 &DownloadFeedbackService::FeedbackComplete, base::Unretained(this))); | 187 &DownloadFeedbackService::FeedbackComplete, base::Unretained(this))); |
188 } | 188 } |
189 | 189 |
190 void DownloadFeedbackService::BeginFeedback(const std::string& ping_request, | 190 void DownloadFeedbackService::BeginFeedback(const std::string& ping_request, |
(...skipping 14 matching lines...) Expand all Loading... |
205 void DownloadFeedbackService::FeedbackComplete() { | 205 void DownloadFeedbackService::FeedbackComplete() { |
206 DVLOG(1) << __func__; | 206 DVLOG(1) << __func__; |
207 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 207 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
208 DCHECK(!active_feedback_.empty()); | 208 DCHECK(!active_feedback_.empty()); |
209 active_feedback_.pop(); | 209 active_feedback_.pop(); |
210 if (!active_feedback_.empty()) | 210 if (!active_feedback_.empty()) |
211 StartPendingFeedback(); | 211 StartPendingFeedback(); |
212 } | 212 } |
213 | 213 |
214 } // namespace safe_browsing | 214 } // namespace safe_browsing |
OLD | NEW |