| 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 <errno.h> | 7 #include <errno.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/strings/stringprintf.h" | |
| 14 | 13 |
| 15 namespace net { | 14 namespace net { |
| 16 | 15 |
| 17 Error MapSystemError(logging::SystemErrorCode os_error) { | 16 Error MapSystemError(logging::SystemErrorCode os_error) { |
| 18 if (os_error != 0) | 17 if (os_error != 0) |
| 19 DVLOG(2) << "Error " << os_error; | 18 DVLOG(2) << "Error " << os_error; |
| 20 | 19 |
| 21 // There are numerous posix error codes, but these are the ones we thus far | 20 // There are numerous posix error codes, but these are the ones we thus far |
| 22 // find interesting. | 21 // find interesting. |
| 23 switch (os_error) { | 22 switch (os_error) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 case 0: | 112 case 0: |
| 114 return OK; | 113 return OK; |
| 115 default: | 114 default: |
| 116 LOG(WARNING) << "Unknown error " << os_error | 115 LOG(WARNING) << "Unknown error " << os_error |
| 117 << " mapped to net::ERR_FAILED"; | 116 << " mapped to net::ERR_FAILED"; |
| 118 return ERR_FAILED; | 117 return ERR_FAILED; |
| 119 } | 118 } |
| 120 } | 119 } |
| 121 | 120 |
| 122 } // namespace net | 121 } // namespace net |
| OLD | NEW |