OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/download/base_file.h" | 5 #include "content/browser/download/base_file.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
192 DCHECK(!detached_); | 192 DCHECK(!detached_); |
193 | 193 |
194 bound_net_log_.AddEvent(net::NetLog::TYPE_CANCELLED); | 194 bound_net_log_.AddEvent(net::NetLog::TYPE_CANCELLED); |
195 | 195 |
196 Close(); | 196 Close(); |
197 | 197 |
198 if (!full_path_.empty()) { | 198 if (!full_path_.empty()) { |
199 bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DELETED); | 199 bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DELETED); |
200 | 200 |
201 base::Delete(full_path_, false); | 201 base::DeleteFile(full_path_, false); |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 void BaseFile::Finish() { | 205 void BaseFile::Finish() { |
206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
207 | 207 |
208 if (calculate_hash_) | 208 if (calculate_hash_) |
209 secure_hash_->Finish(sha256_hash_, kSha256HashLen); | 209 secure_hash_->Finish(sha256_hash_, kSha256HashLen); |
210 | 210 |
211 Close(); | 211 Close(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 const char* operation, | 358 const char* operation, |
359 int os_error, | 359 int os_error, |
360 DownloadInterruptReason reason) { | 360 DownloadInterruptReason reason) { |
361 bound_net_log_.AddEvent( | 361 bound_net_log_.AddEvent( |
362 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, | 362 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, |
363 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); | 363 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); |
364 return reason; | 364 return reason; |
365 } | 365 } |
366 | 366 |
367 } // namespace content | 367 } // namespace content |
OLD | NEW |