Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: components/cronet/android/url_request_error.h

Issue 1393713005: [Cronet] Add error code and immediatelyRetryable() to UrlRequestException (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix missing test annotation Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698