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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_INTERRUPT_REASONS_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_INTERRUPT_REASONS_IMPL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_INTERRUPT_REASONS_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_INTERRUPT_REASONS_IMPL_H_ |
7 | 7 |
| 8 #include "base/files/file.h" |
8 #include "content/public/browser/download_interrupt_reasons.h" | 9 #include "content/public/browser/download_interrupt_reasons.h" |
9 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
10 | 11 |
11 namespace content { | 12 namespace content { |
12 | 13 |
13 enum DownloadInterruptSource { | 14 enum DownloadInterruptSource { |
14 DOWNLOAD_INTERRUPT_FROM_DISK, | 15 DOWNLOAD_INTERRUPT_FROM_DISK, |
15 DOWNLOAD_INTERRUPT_FROM_NETWORK, | 16 DOWNLOAD_INTERRUPT_FROM_NETWORK, |
16 DOWNLOAD_INTERRUPT_FROM_SERVER, | 17 DOWNLOAD_INTERRUPT_FROM_SERVER, |
17 DOWNLOAD_INTERRUPT_FROM_USER, | 18 DOWNLOAD_INTERRUPT_FROM_USER, |
18 DOWNLOAD_INTERRUPT_FROM_CRASH | 19 DOWNLOAD_INTERRUPT_FROM_CRASH |
19 }; | 20 }; |
20 | 21 |
21 // Safe to call from any thread. | 22 // Safe to call from any thread. |
22 DownloadInterruptReason CONTENT_EXPORT ConvertNetErrorToInterruptReason( | 23 DownloadInterruptReason CONTENT_EXPORT ConvertNetErrorToInterruptReason( |
23 net::Error file_error, DownloadInterruptSource source); | 24 net::Error file_error, DownloadInterruptSource source); |
24 | 25 |
| 26 // Safe to call from any thread. |
| 27 DownloadInterruptReason CONTENT_EXPORT ConvertFileErrorToInterruptReason( |
| 28 base::File::Error file_error); |
| 29 |
25 } // namespace content | 30 } // namespace content |
26 | 31 |
27 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_INTERRUPT_REASONS_IMPL_H_ | 32 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_INTERRUPT_REASONS_IMPL_H_ |
OLD | NEW |