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

Side by Side Diff: components/cronet/android/url_request_error.cc

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, 10 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/cronet/android/url_request_error.h"
6
7 #include "net/base/net_errors.h"
8
9 namespace cronet {
10
11 UrlRequestError NetErrorToUrlRequestError(int net_error) {
12 switch (net_error) {
13 case net::ERR_NAME_NOT_RESOLVED:
14 return HOSTNAME_NOT_RESOLVED;
15 case net::ERR_INTERNET_DISCONNECTED:
16 return INTERNET_DISCONNECTED;
17 case net::ERR_NETWORK_CHANGED:
18 return NETWORK_CHANGED;
19 case net::ERR_TIMED_OUT:
20 return TIMED_OUT;
21 case net::ERR_CONNECTION_CLOSED:
22 return CONNECTION_CLOSED;
23 case net::ERR_CONNECTION_TIMED_OUT:
24 return CONNECTION_TIMED_OUT;
25 case net::ERR_CONNECTION_REFUSED:
26 return CONNECTION_REFUSED;
27 case net::ERR_CONNECTION_RESET:
28 return CONNECTION_RESET;
29 case net::ERR_ADDRESS_UNREACHABLE:
30 return ADDRESS_UNREACHABLE;
31 default:
32 return OTHER;
33 }
34 }
35
36 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698