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

Side by Side Diff: chrome/browser/safe_browsing/download_feedback_service.cc

Issue 2821193005: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/safe_browsing (Closed)
Patch Set: Created 3 years, 8 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 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/download_feedback.cc ('k') | chrome/browser/safe_browsing/download_protection_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698