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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util_proxy.h" | 9 #include "base/files/file_util_proxy.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 DownloadFeedbackImpl::~DownloadFeedbackImpl() { | 101 DownloadFeedbackImpl::~DownloadFeedbackImpl() { |
102 DCHECK(CalledOnValidThread()); | 102 DCHECK(CalledOnValidThread()); |
103 DVLOG(1) << "DownloadFeedback destructed " << this; | 103 DVLOG(1) << "DownloadFeedback destructed " << this; |
104 | 104 |
105 if (uploader_) { | 105 if (uploader_) { |
106 RecordUploadResult(UPLOAD_CANCELLED); | 106 RecordUploadResult(UPLOAD_CANCELLED); |
107 // Destroy the uploader before attempting to delete the file. | 107 // Destroy the uploader before attempting to delete the file. |
108 uploader_.reset(); | 108 uploader_.reset(); |
109 } | 109 } |
110 | 110 |
111 base::FileUtilProxy::Delete(file_task_runner_.get(), | 111 base::FileUtilProxy::DeleteFile(file_task_runner_.get(), |
112 file_path_, | 112 file_path_, |
113 false, | 113 false, |
114 base::FileUtilProxy::StatusCallback()); | 114 base::FileUtilProxy::StatusCallback()); |
115 } | 115 } |
116 | 116 |
117 void DownloadFeedbackImpl::Start(const base::Closure& finish_callback) { | 117 void DownloadFeedbackImpl::Start(const base::Closure& finish_callback) { |
118 DCHECK(CalledOnValidThread()); | 118 DCHECK(CalledOnValidThread()); |
119 DCHECK(!uploader_); | 119 DCHECK(!uploader_); |
120 | 120 |
121 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 121 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
122 | 122 |
123 ClientDownloadReport report_metadata; | 123 ClientDownloadReport report_metadata; |
124 | 124 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 return new DownloadFeedbackImpl( | 220 return new DownloadFeedbackImpl( |
221 request_context_getter, file_task_runner, file_path, ping_request, | 221 request_context_getter, file_task_runner, file_path, ping_request, |
222 ping_response); | 222 ping_response); |
223 return DownloadFeedback::factory_->CreateDownloadFeedback( | 223 return DownloadFeedback::factory_->CreateDownloadFeedback( |
224 request_context_getter, file_task_runner, file_path, ping_request, | 224 request_context_getter, file_task_runner, file_path, ping_request, |
225 ping_response); | 225 ping_response); |
226 } | 226 } |
227 | 227 |
228 } // namespace safe_browsing | 228 } // namespace safe_browsing |
229 | 229 |
OLD | NEW |