Chromium Code Reviews| Index: components/cronet/android/url_request_error.h |
| diff --git a/components/cronet/android/url_request_error.h b/components/cronet/android/url_request_error.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..166966e689f81ef177a56503207b3a0c7b82f545 |
| --- /dev/null |
| +++ b/components/cronet/android/url_request_error.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ |
| +#define COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ |
| + |
| +namespace cronet { |
| + |
| +// Error codes for the most popular network stack error codes. |
| +// For descriptions see corresponding constants in UrlRequestException.java. |
| +// A Java counterpart will be generated for this enum. |
| +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net |
| +enum UrlRequestError { |
|
xunjieli
2016/04/23 10:37:15
It turns out that there is already a java class wi
pauljensen
2016/04/29 14:39:05
I don't see a benefit to doing it Java-side. I th
|
| + LISTENER_EXCEPTION_THROWN, |
| + HOSTNAME_NOT_RESOLVED, |
| + INTERNET_DISCONNECTED, |
| + NETWORK_CHANGED, |
| + TIMED_OUT, |
| + CONNECTION_CLOSED, |
| + CONNECTION_TIMED_OUT, |
| + CONNECTION_REFUSED, |
| + CONNECTION_RESET, |
| + ADDRESS_UNREACHABLE, |
| + OTHER, |
| +}; |
| + |
| +// Converts most popular net::ERR_* values to counterparts accessible in Java. |
| +UrlRequestError NetErrorToUrlRequestError(int net_error); |
| + |
| +} // namespace cronet |
| + |
| +#endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ERROR_H_ |