OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/base/net_errors.h" | 5 #include "net/base/net_errors.h" |
6 | 6 |
7 #include <winsock2.h> | 7 #include <winsock2.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 case ERROR_FILE_TOO_LARGE: // The file size exceeds the limit allowed | 103 case ERROR_FILE_TOO_LARGE: // The file size exceeds the limit allowed |
104 return ERR_FILE_NO_SPACE; // and cannot be saved. | 104 return ERR_FILE_NO_SPACE; // and cannot be saved. |
105 case ERROR_VIRUS_INFECTED: // Operation failed because the file | 105 case ERROR_VIRUS_INFECTED: // Operation failed because the file |
106 return ERR_FILE_VIRUS_INFECTED; // contains a virus. | 106 return ERR_FILE_VIRUS_INFECTED; // contains a virus. |
107 case ERROR_IO_DEVICE: // The request could not be performed | 107 case ERROR_IO_DEVICE: // The request could not be performed |
108 return ERR_ACCESS_DENIED; // because of an I/O device error. | 108 return ERR_ACCESS_DENIED; // because of an I/O device error. |
109 case ERROR_POSSIBLE_DEADLOCK: // A potential deadlock condition has | 109 case ERROR_POSSIBLE_DEADLOCK: // A potential deadlock condition has |
110 return ERR_ACCESS_DENIED; // been detected. | 110 return ERR_ACCESS_DENIED; // been detected. |
111 case ERROR_BAD_DEVICE: // The specified device name is invalid. | 111 case ERROR_BAD_DEVICE: // The specified device name is invalid. |
112 return ERR_INVALID_ARGUMENT; | 112 return ERR_INVALID_ARGUMENT; |
113 case ERROR_BROKEN_PIPE: // Pipe is not connected. | |
114 return ERR_CONNECTION_RESET; | |
wtc
2013/09/25 23:03:12
On Unix, we map EPIPE to ERR_CONNECTION_RESET. The
| |
113 | 115 |
114 case ERROR_SUCCESS: | 116 case ERROR_SUCCESS: |
115 return OK; | 117 return OK; |
116 default: | 118 default: |
117 LOG(WARNING) << "Unknown error " << os_error | 119 LOG(WARNING) << "Unknown error " << os_error |
118 << " mapped to net::ERR_FAILED"; | 120 << " mapped to net::ERR_FAILED"; |
119 return ERR_FAILED; | 121 return ERR_FAILED; |
120 } | 122 } |
121 } | 123 } |
122 | 124 |
123 } // namespace net | 125 } // namespace net |
OLD | NEW |