| OLD | NEW |
| 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.urlconnection; | 5 package org.chromium.net.urlconnection; |
| 6 | 6 |
| 7 import android.util.Pair; | 7 import android.util.Pair; |
| 8 | 8 |
| 9 import org.chromium.base.Log; | 9 import org.chromium.base.Log; |
| 10 import org.chromium.net.CronetEngine; | 10 import org.chromium.net.CronetEngine; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 import java.nio.ByteBuffer; | 25 import java.nio.ByteBuffer; |
| 26 import java.util.ArrayList; | 26 import java.util.ArrayList; |
| 27 import java.util.Collections; | 27 import java.util.Collections; |
| 28 import java.util.List; | 28 import java.util.List; |
| 29 import java.util.Map; | 29 import java.util.Map; |
| 30 import java.util.TreeMap; | 30 import java.util.TreeMap; |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * An implementation of {@link HttpURLConnection} that uses Cronet to send | 33 * An implementation of {@link HttpURLConnection} that uses Cronet to send |
| 34 * requests and receive responses. | 34 * requests and receive responses. |
| 35 * @deprecated use {@link CronetEngine#openConnection}. |
| 35 */ | 36 */ |
| 36 class CronetHttpURLConnection extends HttpURLConnection { | 37 public class CronetHttpURLConnection extends HttpURLConnection { |
| 37 private static final String TAG = "cr.CronetHttpURLConn"; | 38 private static final String TAG = "cr.CronetHttpURLConn"; |
| 38 private static final String CONTENT_LENGTH = "Content-Length"; | 39 private static final String CONTENT_LENGTH = "Content-Length"; |
| 39 private final CronetEngine mCronetEngine; | 40 private final CronetEngine mCronetEngine; |
| 40 private final MessageLoop mMessageLoop; | 41 private final MessageLoop mMessageLoop; |
| 41 private UrlRequest mRequest; | 42 private UrlRequest mRequest; |
| 42 private final List<Pair<String, String>> mRequestHeaders; | 43 private final List<Pair<String, String>> mRequestHeaders; |
| 43 | 44 |
| 44 private CronetInputStream mInputStream; | 45 private CronetInputStream mInputStream; |
| 45 private CronetOutputStream mOutputStream; | 46 private CronetOutputStream mOutputStream; |
| 46 private ResponseInfo mResponseInfo; | 47 private ResponseInfo mResponseInfo; |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 } | 538 } |
| 538 | 539 |
| 539 /** | 540 /** |
| 540 * Returns whether the client has used {@link #setChunkedStreamingMode} to | 541 * Returns whether the client has used {@link #setChunkedStreamingMode} to |
| 541 * set chunked encoding for upload. | 542 * set chunked encoding for upload. |
| 542 */ | 543 */ |
| 543 private boolean isChunkedUpload() { | 544 private boolean isChunkedUpload() { |
| 544 return chunkLength > 0; | 545 return chunkLength > 0; |
| 545 } | 546 } |
| 546 } | 547 } |
| OLD | NEW |