Chromium Code Reviews| 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 "net/base/net_errors.h" | 5 #include "net/base/net_errors.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/stringize_macros.h" | 9 #include "base/strings/stringize_macros.h" |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 return net::ERR_ACCESS_DENIED; | 52 return net::ERR_ACCESS_DENIED; |
| 53 case base::File::FILE_ERROR_INVALID_URL: | 53 case base::File::FILE_ERROR_INVALID_URL: |
| 54 return net::ERR_INVALID_URL; | 54 return net::ERR_INVALID_URL; |
| 55 case base::File::FILE_ERROR_NOT_FOUND: | 55 case base::File::FILE_ERROR_NOT_FOUND: |
| 56 return net::ERR_FILE_NOT_FOUND; | 56 return net::ERR_FILE_NOT_FOUND; |
| 57 default: | 57 default: |
| 58 return net::ERR_FAILED; | 58 return net::ERR_FAILED; |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 int MapSystemErrorWithDefault(int os_error, int default_net_error) { | |
| 63 int net_error = MapSystemError(os_error); | |
| 64 if (net_error != OK) | |
| 65 return net_error; | |
| 66 DLOG(WARNING) << "OS Error was not set meaningfully " << os_error; | |
|
wtc
2014/04/09 15:34:49
Hmm... the problem with this error message is that
| |
| 67 DCHECK_NE(default_net_error, OK); | |
|
wtc
2014/04/09 15:34:49
This DCHECK should be at the beginning of the func
| |
| 68 return default_net_error; | |
| 69 } | |
| 70 | |
| 62 } // namespace net | 71 } // namespace net |
| OLD | NEW |