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 16 matching lines...) Expand all Loading... |
27 import java.util.List; | 27 import java.util.List; |
28 import java.util.Map; | 28 import java.util.Map; |
29 import java.util.TreeMap; | 29 import java.util.TreeMap; |
30 | 30 |
31 /** | 31 /** |
32 * An implementation of {@link HttpURLConnection} that uses Cronet to send | 32 * An implementation of {@link HttpURLConnection} that uses Cronet to send |
33 * requests and receive responses. | 33 * requests and receive responses. |
34 * {@hide} | 34 * {@hide} |
35 */ | 35 */ |
36 public class CronetHttpURLConnection extends HttpURLConnection { | 36 public class CronetHttpURLConnection extends HttpURLConnection { |
37 private static final String TAG = "cr_CronetHttpURLConn"; | 37 private static final String TAG = CronetHttpURLConnection.class.getSimpleNam
e(); |
38 private static final String CONTENT_LENGTH = "Content-Length"; | 38 private static final String CONTENT_LENGTH = "Content-Length"; |
39 private final CronetEngine mCronetEngine; | 39 private final CronetEngine mCronetEngine; |
40 private final MessageLoop mMessageLoop; | 40 private final MessageLoop mMessageLoop; |
41 private UrlRequest mRequest; | 41 private UrlRequest mRequest; |
42 private final List<Pair<String, String>> mRequestHeaders; | 42 private final List<Pair<String, String>> mRequestHeaders; |
43 | 43 |
44 private CronetInputStream mInputStream; | 44 private CronetInputStream mInputStream; |
45 private CronetOutputStream mOutputStream; | 45 private CronetOutputStream mOutputStream; |
46 private UrlResponseInfo mResponseInfo; | 46 private UrlResponseInfo mResponseInfo; |
47 private CronetException mException; | 47 private CronetException mException; |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 // Strips Content-Encoding response header. See crbug.com/592700. | 600 // Strips Content-Encoding response header. See crbug.com/592700. |
601 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) { | 601 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) { |
602 mResponseHeadersList.add( | 602 mResponseHeadersList.add( |
603 new AbstractMap.SimpleImmutableEntry<String, String>(ent
ry)); | 603 new AbstractMap.SimpleImmutableEntry<String, String>(ent
ry)); |
604 } | 604 } |
605 } | 605 } |
606 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList
); | 606 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList
); |
607 return mResponseHeadersList; | 607 return mResponseHeadersList; |
608 } | 608 } |
609 } | 609 } |
OLD | NEW |