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/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DETACHED); | 175 bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DETACHED); |
176 } | 176 } |
177 | 177 |
178 void BaseFile::Cancel() { | 178 void BaseFile::Cancel() { |
179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
180 DCHECK(!detached_); | 180 DCHECK(!detached_); |
181 | 181 |
182 bound_net_log_.AddEvent(net::NetLog::TYPE_CANCELLED); | 182 bound_net_log_.AddEvent(net::NetLog::TYPE_CANCELLED); |
183 | 183 |
184 Close(); | 184 Close(); |
185 Detach(); | |
Randy Smith (Not in Mondays)
2014/05/23 19:05:21
Hmmm. I'm a bit uncomfortable with the abstractio
| |
185 | 186 |
186 if (!full_path_.empty()) { | 187 if (!full_path_.empty()) { |
187 bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DELETED); | 188 bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DELETED); |
188 | 189 |
189 base::DeleteFile(full_path_, false); | 190 base::DeleteFile(full_path_, false); |
190 } | 191 } |
191 } | 192 } |
192 | 193 |
193 void BaseFile::Finish() { | 194 void BaseFile::Finish() { |
194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 const char* operation, | 337 const char* operation, |
337 int os_error, | 338 int os_error, |
338 DownloadInterruptReason reason) { | 339 DownloadInterruptReason reason) { |
339 bound_net_log_.AddEvent( | 340 bound_net_log_.AddEvent( |
340 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, | 341 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, |
341 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); | 342 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); |
342 return reason; | 343 return reason; |
343 } | 344 } |
344 | 345 |
345 } // namespace content | 346 } // namespace content |
OLD | NEW |