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

Issue 1393713005: [Cronet] Add error code and immediatelyRetryable() to UrlRequestException (Closed)

Created:
5 years, 2 months ago by pauljensen
Modified:
4 years, 7 months ago
Reviewers:
xunjieli
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Cronet] Add error code and immediatelyRetryable() to UrlRequestException Add a getErrorCode() method to UrlRequestException and define constant values for the most common failures. This allows embedders to make decisions based on the error codes without worrying about Cronet's internal error codes changing. Add immediatelyRetryable() metod to UrlRequestException to help embedders decide which requests should be retried. BUG=531538 Committed: https://crrev.com/867dd4b5fc023427c6cc5b1dffd5f2a65cc9e901 Cr-Commit-Position: refs/heads/master@{#373042}

Patch Set 1 #

Patch Set 2 : #

Total comments: 18

Patch Set 3 : rebase and fix a slew of merge conflicts #

Patch Set 4 : Address Helen's comments #

Total comments: 15

Patch Set 5 : sync #

Patch Set 6 : address comments #

Patch Set 7 : address comment and get building #

Total comments: 2

Patch Set 8 : fix javadoc issue #

Patch Set 9 : start gn work #

Patch Set 10 : sync #

Patch Set 11 : lots of work #

Patch Set 12 : rebase #

Patch Set 13 : add missing files #

Patch Set 14 : rebase #

Patch Set 15 : add missing dependency #

Patch Set 16 : update tests #

Patch Set 17 : fix missing test annotation #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+349 lines, -46 lines) Patch
M components/cronet.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +30 lines, -2 lines 0 comments Download
M components/cronet/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 8 chunks +24 lines, -4 lines 0 comments Download
M components/cronet/android/api/build.xml View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M components/cronet/android/api/src/org/chromium/net/BidirectionalStream.java View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M components/cronet/android/api/src/org/chromium/net/CronetException.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M components/cronet/android/api/src/org/chromium/net/UrlRequestException.java View 1 2 3 4 5 6 7 1 chunk +138 lines, -12 lines 0 comments Download
A + components/cronet/android/api/src_dummy/org/chromium/net/test/dummy/Dummy.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -3 lines 0 comments Download
M components/cronet/android/chromium_url_request.h View 1 chunk +1 line, -1 line 0 comments Download
M components/cronet/android/cronet_bidirectional_stream_adapter.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M components/cronet/android/cronet_url_request_adapter.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -2 lines 0 comments Download
M components/cronet/android/java/src/org/chromium/net/CronetBidirectionalStream.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -2 lines 0 comments Download
M components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -5 lines 0 comments Download
M components/cronet/android/test/javatests/src/org/chromium/net/BidirectionalStreamTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +45 lines, -4 lines 0 comments Download
M components/cronet/android/test/javatests/src/org/chromium/net/PkpTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -2 lines 0 comments Download
M components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestCallback.java View 1 2 3 4 5 6 7 8 9 2 chunks +10 lines, -0 lines 0 comments Download
A components/cronet/android/url_request_error.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +33 lines, -0 lines 2 comments Download
A components/cronet/android/url_request_error.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +36 lines, -0 lines 0 comments Download
M components/cronet/cronet_static.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -1 line 0 comments Download
M components/cronet/tools/generate_javadoc.py View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 19 (4 generated)
pauljensen
Helen, PTAL.
5 years, 2 months ago (2015-10-09 20:23:12 UTC) #2
xunjieli
https://codereview.chromium.org/1393713005/diff/20001/components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java File components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java (right): https://codereview.chromium.org/1393713005/diff/20001/components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java#newcode732 components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java:732: * @param nativeError native net error code. nit: need ...
5 years, 2 months ago (2015-10-13 23:07:11 UTC) #3
pauljensen
https://codereview.chromium.org/1393713005/diff/20001/components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java File components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java (right): https://codereview.chromium.org/1393713005/diff/20001/components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java#newcode732 components/cronet/android/java/src/org/chromium/net/CronetUrlRequest.java:732: * @param nativeError native net error code. On 2015/10/13 ...
5 years, 1 month ago (2015-11-05 18:35:29 UTC) #4
xunjieli
https://codereview.chromium.org/1393713005/diff/20001/components/cronet/android/java/src/org/chromium/net/UrlRequestException.java File components/cronet/android/java/src/org/chromium/net/UrlRequestException.java (right): https://codereview.chromium.org/1393713005/diff/20001/components/cronet/android/java/src/org/chromium/net/UrlRequestException.java#newcode31 components/cronet/android/java/src/org/chromium/net/UrlRequestException.java:31: public static final int ERROR_LISTENER_THREW = UrlRequestError.LISTENER_THREW; On 2015/11/05 ...
5 years, 1 month ago (2015-11-06 15:23:22 UTC) #5
pauljensen
https://codereview.chromium.org/1393713005/diff/60001/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java File components/cronet/android/api/src/org/chromium/net/UrlRequestException.java (right): https://codereview.chromium.org/1393713005/diff/60001/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java#newcode15 components/cronet/android/api/src/org/chromium/net/UrlRequestException.java:15: * <li>Cronet fails to process a network request. In ...
4 years, 11 months ago (2016-01-25 01:43:51 UTC) #6
pauljensen
PTAL. I had to make a change to get javadocs building. https://codereview.chromium.org/1393713005/diff/20001/components/cronet/android/java/src/org/chromium/net/UrlRequestException.java File components/cronet/android/java/src/org/chromium/net/UrlRequestException.java (right): ...
4 years, 11 months ago (2016-01-25 02:08:16 UTC) #7
xunjieli
https://codereview.chromium.org/1393713005/diff/60001/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java File components/cronet/android/api/src/org/chromium/net/UrlRequestException.java (right): https://codereview.chromium.org/1393713005/diff/60001/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java#newcode97 components/cronet/android/api/src/org/chromium/net/UrlRequestException.java:97: public UrlRequestException(String message, int errorCode, int cronetInternalErrorCode) { On ...
4 years, 11 months ago (2016-01-25 14:37:02 UTC) #8
pauljensen
https://codereview.chromium.org/1393713005/diff/90009/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java File components/cronet/android/api/src/org/chromium/net/UrlRequestException.java (right): https://codereview.chromium.org/1393713005/diff/90009/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java#newcode88 components/cronet/android/api/src/org/chromium/net/UrlRequestException.java:88: // generation will fail because it is not passed ...
4 years, 10 months ago (2016-02-02 18:45:45 UTC) #9
pauljensen
PTAL, thank you!
4 years, 10 months ago (2016-02-02 18:46:00 UTC) #10
xunjieli
On 2016/02/02 18:46:00, pauljensen wrote: > PTAL, thank you! lgtm. Thanks!
4 years, 10 months ago (2016-02-02 19:02:25 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1393713005/310001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1393713005/310001
4 years, 10 months ago (2016-02-02 20:00:14 UTC) #14
commit-bot: I haz the power
Committed patchset #17 (id:310001)
4 years, 10 months ago (2016-02-02 21:23:03 UTC) #15
commit-bot: I haz the power
Patchset 17 (id:??) landed as https://crrev.com/867dd4b5fc023427c6cc5b1dffd5f2a65cc9e901 Cr-Commit-Position: refs/heads/master@{#373042}
4 years, 10 months ago (2016-02-02 21:24:20 UTC) #17
xunjieli
https://codereview.chromium.org/1393713005/diff/310001/components/cronet/android/url_request_error.h File components/cronet/android/url_request_error.h (right): https://codereview.chromium.org/1393713005/diff/310001/components/cronet/android/url_request_error.h#newcode14 components/cronet/android/url_request_error.h:14: enum UrlRequestError { It turns out that there is ...
4 years, 8 months ago (2016-04-23 10:37:16 UTC) #18
pauljensen
4 years, 7 months ago (2016-04-29 14:39:05 UTC) #19
Message was sent while issue was closed.
https://codereview.chromium.org/1393713005/diff/310001/components/cronet/andr...
File components/cronet/android/url_request_error.h (right):

https://codereview.chromium.org/1393713005/diff/310001/components/cronet/andr...
components/cronet/android/url_request_error.h:14: enum UrlRequestError {
On 2016/04/23 10:37:15, xunjieli wrote:
> It turns out that there is already a java class with all NetError codes as
> static ints
>
(https://code.google.com/p/chromium/codesearch#search/&q=NetError%20file:java$...).
> Andrei told me about it.
> We should probably get rid of this and do the mapping and retryable logic
> entirely Java side. WDYT?

I don't see a benefit to doing it Java-side.  I think there may actually be
benefits to doing it native side:
1. native code may be smaller, and is certainly faster
2. UrlRequestException is in the API side, rather than the implementation side,
and it may be much harder to make changes in the API side, e.g. if the
implementation side is auto-updated but the API side is linked into an app.

Powered by Google App Engine
This is Rietveld 408576698