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

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequest.java

Issue 1141943003: Remove cronet dependency on org.apache.http. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import android.util.Log; 7 import android.util.Log;
8 8
9 import org.apache.http.conn.ConnectTimeoutException;
10 import org.chromium.base.CalledByNative; 9 import org.chromium.base.CalledByNative;
11 import org.chromium.base.JNINamespace; 10 import org.chromium.base.JNINamespace;
12 import org.chromium.base.annotations.SuppressFBWarnings; 11 import org.chromium.base.annotations.SuppressFBWarnings;
13 12
14 import java.io.IOException; 13 import java.io.IOException;
15 import java.net.MalformedURLException; 14 import java.net.MalformedURLException;
15 import java.net.SocketTimeoutException;
16 import java.net.URL; 16 import java.net.URL;
17 import java.net.UnknownHostException; 17 import java.net.UnknownHostException;
18 import java.nio.ByteBuffer; 18 import java.nio.ByteBuffer;
19 import java.nio.channels.ReadableByteChannel; 19 import java.nio.channels.ReadableByteChannel;
20 import java.nio.channels.WritableByteChannel; 20 import java.nio.channels.WritableByteChannel;
21 import java.util.ArrayList; 21 import java.util.ArrayList;
22 import java.util.HashMap; 22 import java.util.HashMap;
23 import java.util.List; 23 import java.util.List;
24 import java.util.Map; 24 import java.util.Map;
25 import java.util.Map.Entry; 25 import java.util.Map.Entry;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 case ChromiumUrlRequestError.SUCCESS: 179 case ChromiumUrlRequestError.SUCCESS:
180 if (mContentLengthOverLimit) { 180 if (mContentLengthOverLimit) {
181 return new ResponseTooLargeException(); 181 return new ResponseTooLargeException();
182 } 182 }
183 return null; 183 return null;
184 case ChromiumUrlRequestError.UNKNOWN: 184 case ChromiumUrlRequestError.UNKNOWN:
185 return new IOException(mErrorString); 185 return new IOException(mErrorString);
186 case ChromiumUrlRequestError.MALFORMED_URL: 186 case ChromiumUrlRequestError.MALFORMED_URL:
187 return new MalformedURLException("Malformed URL: " + mUrl); 187 return new MalformedURLException("Malformed URL: " + mUrl);
188 case ChromiumUrlRequestError.CONNECTION_TIMED_OUT: 188 case ChromiumUrlRequestError.CONNECTION_TIMED_OUT:
189 return new ConnectTimeoutException("Connection timed out"); 189 return new SocketTimeoutException("Connection timed out");
Yaron 2015/05/15 15:20:21 Not sure how we originally chose ConnectTimeoutExc
190 case ChromiumUrlRequestError.UNKNOWN_HOST: 190 case ChromiumUrlRequestError.UNKNOWN_HOST:
191 String host; 191 String host;
192 try { 192 try {
193 host = new URL(mUrl).getHost(); 193 host = new URL(mUrl).getHost();
194 } catch (MalformedURLException e) { 194 } catch (MalformedURLException e) {
195 host = mUrl; 195 host = mUrl;
196 } 196 }
197 return new UnknownHostException("Unknown host: " + host); 197 return new UnknownHostException("Unknown host: " + host);
198 case ChromiumUrlRequestError.TOO_MANY_REDIRECTS: 198 case ChromiumUrlRequestError.TOO_MANY_REDIRECTS:
199 return new IOException("Request failed because there were too " 199 return new IOException("Request failed because there were too "
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 757
758 private native String nativeGetNegotiatedProtocol(long urlRequestAdapter); 758 private native String nativeGetNegotiatedProtocol(long urlRequestAdapter);
759 759
760 private native boolean nativeGetWasCached(long urlRequestAdapter); 760 private native boolean nativeGetWasCached(long urlRequestAdapter);
761 761
762 // Explicit class to work around JNI-generator generics confusion. 762 // Explicit class to work around JNI-generator generics confusion.
763 private static class ResponseHeadersMap extends 763 private static class ResponseHeadersMap extends
764 HashMap<String, List<String>> { 764 HashMap<String, List<String>> {
765 } 765 }
766 } 766 }
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698