| 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 = "cr." + CronetHttpURLConnection.class.getS
impleName(); |
| 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 UrlRequestException mException; | 47 private UrlRequestException mException; |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 // Strips Content-Encoding response header. See crbug.com/592700. | 597 // Strips Content-Encoding response header. See crbug.com/592700. |
| 598 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) { | 598 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) { |
| 599 mResponseHeadersList.add( | 599 mResponseHeadersList.add( |
| 600 new AbstractMap.SimpleImmutableEntry<String, String>(ent
ry)); | 600 new AbstractMap.SimpleImmutableEntry<String, String>(ent
ry)); |
| 601 } | 601 } |
| 602 } | 602 } |
| 603 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList
); | 603 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList
); |
| 604 return mResponseHeadersList; | 604 return mResponseHeadersList; |
| 605 } | 605 } |
| 606 } | 606 } |
| OLD | NEW |