| 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/download_interrupt_reasons_impl.h" | 5 #include "content/browser/download/download_interrupt_reasons_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // The server has gone down. | 91 // The server has gone down. |
| 92 case net::ERR_CONNECTION_FAILED: | 92 case net::ERR_CONNECTION_FAILED: |
| 93 return DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN; | 93 return DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN; |
| 94 | 94 |
| 95 // Server responses. | 95 // Server responses. |
| 96 | 96 |
| 97 // The server does not support range requests. | 97 // The server does not support range requests. |
| 98 case net::ERR_REQUEST_RANGE_NOT_SATISFIABLE: | 98 case net::ERR_REQUEST_RANGE_NOT_SATISFIABLE: |
| 99 return DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE; | 99 return DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE; |
| 100 | 100 |
| 101 case net::ERR_CONTENT_LENGTH_MISMATCH: |
| 102 return DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH; |
| 103 |
| 101 default: break; | 104 default: break; |
| 102 } | 105 } |
| 103 | 106 |
| 104 // Handle errors that don't have mappings, depending on the source. | 107 // Handle errors that don't have mappings, depending on the source. |
| 105 switch (source) { | 108 switch (source) { |
| 106 case DOWNLOAD_INTERRUPT_FROM_DISK: | 109 case DOWNLOAD_INTERRUPT_FROM_DISK: |
| 107 return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED; | 110 return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED; |
| 108 case DOWNLOAD_INTERRUPT_FROM_NETWORK: | 111 case DOWNLOAD_INTERRUPT_FROM_NETWORK: |
| 109 return DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED; | 112 return DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED; |
| 110 case DOWNLOAD_INTERRUPT_FROM_SERVER: | 113 case DOWNLOAD_INTERRUPT_FROM_SERVER: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 131 default: | 134 default: |
| 132 break; | 135 break; |
| 133 } | 136 } |
| 134 | 137 |
| 135 #undef INTERRUPT_REASON | 138 #undef INTERRUPT_REASON |
| 136 | 139 |
| 137 return "Unknown error"; | 140 return "Unknown error"; |
| 138 } | 141 } |
| 139 | 142 |
| 140 } // namespace content | 143 } // namespace content |
| OLD | NEW |