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" |
11 #include "base/platform_file.h" | 11 #include "base/files/file.h" |
12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 // Error domain of the net module's error codes. | 16 // Error domain of the net module's error codes. |
17 NET_EXPORT extern const char kErrorDomain[]; | 17 NET_EXPORT extern const char kErrorDomain[]; |
18 | 18 |
19 // Error values are negative. | 19 // Error values are negative. |
20 enum Error { | 20 enum Error { |
21 // No error. | 21 // No error. |
(...skipping 24 matching lines...) Expand all Loading... |
46 | 46 |
47 // Returns a list of all the possible net error codes (not counting OK). This | 47 // Returns a list of all the possible net error codes (not counting OK). This |
48 // is intended for use with UMA histograms that are reporting the result of | 48 // is intended for use with UMA histograms that are reporting the result of |
49 // an action that is represented as a net error code. | 49 // an action that is represented as a net error code. |
50 // | 50 // |
51 // Note that the error codes are all positive (since histograms expect positive | 51 // Note that the error codes are all positive (since histograms expect positive |
52 // sample values). Also note that a guard bucket is created after any valid | 52 // sample values). Also note that a guard bucket is created after any valid |
53 // error code that is not followed immediately by a valid error code. | 53 // error code that is not followed immediately by a valid error code. |
54 NET_EXPORT std::vector<int> GetAllErrorCodesForUma(); | 54 NET_EXPORT std::vector<int> GetAllErrorCodesForUma(); |
55 | 55 |
56 // A convenient function to translate platform file error to net error code. | 56 // A convenient function to translate file error to net error code. |
57 NET_EXPORT Error PlatformFileErrorToNetError( | 57 NET_EXPORT Error FileErrorToNetError(base::File::Error file_error); |
58 base::PlatformFileError file_error); | |
59 | 58 |
60 } // namespace net | 59 } // namespace net |
61 | 60 |
62 #endif // NET_BASE_NET_ERRORS_H__ | 61 #endif // NET_BASE_NET_ERRORS_H__ |
OLD | NEW |