OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ | 5 #ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ |
6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ | 6 #define COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ |
7 | 7 |
8 namespace cronet { | 8 namespace cronet { |
9 | 9 |
10 // Error codes for the most popular network stack error codes. | 10 // Error codes for the most popular network stack error codes. |
11 // For descriptions see corresponding constants in UrlRequestException.java. | 11 // For descriptions see corresponding constants in UrlRequestException.java. |
12 // A Java counterpart will be generated for this enum. | 12 // A Java counterpart will be generated for this enum. |
13 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net | 13 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net.impl |
14 enum UrlRequestError { | 14 enum UrlRequestError { |
15 LISTENER_EXCEPTION_THROWN, | 15 LISTENER_EXCEPTION_THROWN, |
16 HOSTNAME_NOT_RESOLVED, | 16 HOSTNAME_NOT_RESOLVED, |
17 INTERNET_DISCONNECTED, | 17 INTERNET_DISCONNECTED, |
18 NETWORK_CHANGED, | 18 NETWORK_CHANGED, |
19 TIMED_OUT, | 19 TIMED_OUT, |
20 CONNECTION_CLOSED, | 20 CONNECTION_CLOSED, |
21 CONNECTION_TIMED_OUT, | 21 CONNECTION_TIMED_OUT, |
22 CONNECTION_REFUSED, | 22 CONNECTION_REFUSED, |
23 CONNECTION_RESET, | 23 CONNECTION_RESET, |
24 ADDRESS_UNREACHABLE, | 24 ADDRESS_UNREACHABLE, |
25 QUIC_PROTOCOL_FAILED, | 25 QUIC_PROTOCOL_FAILED, |
26 OTHER, | 26 OTHER, |
27 }; | 27 }; |
28 | 28 |
29 // Converts most popular net::ERR_* values to counterparts accessible in Java. | 29 // Converts most popular net::ERR_* values to counterparts accessible in Java. |
30 UrlRequestError NetErrorToUrlRequestError(int net_error); | 30 UrlRequestError NetErrorToUrlRequestError(int net_error); |
31 | 31 |
32 } // namespace cronet | 32 } // namespace cronet |
33 | 33 |
34 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ | 34 #endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ |
OLD | NEW |