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 #ifndef NET_BASE_NET_ERRORS_H__ | 5 #ifndef NET_BASE_NET_ERRORS_H__ |
| 6 #define NET_BASE_NET_ERRORS_H__ | 6 #define NET_BASE_NET_ERRORS_H__ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 // an action that is represented as a net error code. | 50 // an action that is represented as a net error code. |
| 51 // | 51 // |
| 52 // Note that the error codes are all positive (since histograms expect positive | 52 // Note that the error codes are all positive (since histograms expect positive |
| 53 // sample values). Also note that a guard bucket is created after any valid | 53 // sample values). Also note that a guard bucket is created after any valid |
| 54 // error code that is not followed immediately by a valid error code. | 54 // error code that is not followed immediately by a valid error code. |
| 55 NET_EXPORT std::vector<int> GetAllErrorCodesForUma(); | 55 NET_EXPORT std::vector<int> GetAllErrorCodesForUma(); |
| 56 | 56 |
| 57 // A convenient function to translate file error to net error code. | 57 // A convenient function to translate file error to net error code. |
| 58 NET_EXPORT Error FileErrorToNetError(base::File::Error file_error); | 58 NET_EXPORT Error FileErrorToNetError(base::File::Error file_error); |
| 59 | 59 |
| 60 // Return a net_error other than net::OK, based on |os_error|. | |
| 61 // Some older OSs (Mac 10.6?) may fail to set the os_error properly, even when | |
| 62 // a system function returns a failing value. This function is used to map such | |
| 63 // cases into a default net_error, if the net_error would otherwise mistakenly | |
| 64 // report OK (such as when errno was zero). | |
| 65 int MapSystemErrorWithDefault(int os_error, int default_net_error); | |
|
wtc
2014/04/09 15:34:49
Nit: please list this function right below the clo
| |
| 66 | |
| 60 } // namespace net | 67 } // namespace net |
| 61 | 68 |
| 62 #endif // NET_BASE_NET_ERRORS_H__ | 69 #endif // NET_BASE_NET_ERRORS_H__ |
| OLD | NEW |