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.h" | 5 #include "chrome/browser/safe_browsing/download_feedback.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 DVLOG(1) << "DownloadFeedback destructed " << this; | 101 DVLOG(1) << "DownloadFeedback destructed " << this; |
102 | 102 |
103 if (uploader_) { | 103 if (uploader_) { |
104 RecordUploadResult(UPLOAD_CANCELLED); | 104 RecordUploadResult(UPLOAD_CANCELLED); |
105 // Destroy the uploader before attempting to delete the file. | 105 // Destroy the uploader before attempting to delete the file. |
106 uploader_.reset(); | 106 uploader_.reset(); |
107 } | 107 } |
108 | 108 |
109 file_task_runner_->PostTask( | 109 file_task_runner_->PostTask( |
110 FROM_HERE, | 110 FROM_HERE, |
111 base::Bind(base::IgnoreResult(&base::DeleteFile), file_path_, false)); | 111 base::BindOnce(base::IgnoreResult(&base::DeleteFile), file_path_, false)); |
112 } | 112 } |
113 | 113 |
114 void DownloadFeedbackImpl::Start(const base::Closure& finish_callback) { | 114 void DownloadFeedbackImpl::Start(const base::Closure& finish_callback) { |
115 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 115 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
116 DCHECK(!uploader_); | 116 DCHECK(!uploader_); |
117 | 117 |
118 ClientDownloadReport report_metadata; | 118 ClientDownloadReport report_metadata; |
119 | 119 |
120 bool r = report_metadata.mutable_download_request()->ParseFromString( | 120 bool r = report_metadata.mutable_download_request()->ParseFromString( |
121 ping_request_); | 121 ping_request_); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 new DownloadFeedbackImpl(request_context_getter, file_task_runner, | 247 new DownloadFeedbackImpl(request_context_getter, file_task_runner, |
248 file_path, ping_request, ping_response)); | 248 file_path, ping_request, ping_response)); |
249 } | 249 } |
250 return DownloadFeedback::factory_->CreateDownloadFeedback( | 250 return DownloadFeedback::factory_->CreateDownloadFeedback( |
251 request_context_getter, file_task_runner, file_path, ping_request, | 251 request_context_getter, file_task_runner, file_path, ping_request, |
252 ping_response); | 252 ping_response); |
253 } | 253 } |
254 | 254 |
255 } // namespace safe_browsing | 255 } // namespace safe_browsing |
256 | 256 |
OLD | NEW |