| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_INTERRUPT_REASONS_H_ | |
| 6 #define CHROME_BROWSER_DOWNLOAD_INTERRUPT_REASONS_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "content/common/content_export.h" | |
| 12 #include "net/base/net_errors.h" | |
| 13 | |
| 14 enum InterruptReason { | |
| 15 DOWNLOAD_INTERRUPT_REASON_NONE = 0, | |
| 16 | |
| 17 #define INTERRUPT_REASON(name, value) DOWNLOAD_INTERRUPT_REASON_##name = value, | |
| 18 | |
| 19 #include "content/browser/download/interrupt_reason_values.h" | |
| 20 | |
| 21 #undef INTERRUPT_REASON | |
| 22 }; | |
| 23 | |
| 24 enum DownloadInterruptSource { | |
| 25 DOWNLOAD_INTERRUPT_FROM_DISK, | |
| 26 DOWNLOAD_INTERRUPT_FROM_NETWORK, | |
| 27 DOWNLOAD_INTERRUPT_FROM_SERVER, | |
| 28 DOWNLOAD_INTERRUPT_FROM_USER, | |
| 29 DOWNLOAD_INTERRUPT_FROM_CRASH | |
| 30 }; | |
| 31 | |
| 32 // Safe to call from any thread. | |
| 33 InterruptReason CONTENT_EXPORT ConvertNetErrorToInterruptReason( | |
| 34 net::Error file_error, DownloadInterruptSource source); | |
| 35 | |
| 36 std::string CONTENT_EXPORT InterruptReasonDebugString(InterruptReason error); | |
| 37 | |
| 38 #endif // CHROME_BROWSER_DOWNLOAD_INTERRUPT_REASONS_H_ | |
| OLD | NEW |