| 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; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 | 8 |
| 9 import java.io.IOException; | 9 import java.io.IOException; |
| 10 import java.io.PrintWriter; | 10 import java.io.PrintWriter; |
| 11 import java.nio.channels.WritableByteChannel; | 11 import java.nio.channels.WritableByteChannel; |
| 12 import java.util.Map; | 12 import java.util.Map; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * Network request using {@link java.net.HttpURLConnection}. | 15 * Network request using {@link java.net.HttpURLConnection}. |
| 16 */ | 16 */ |
| 17 class HttpUrlConnectionUrlRequestFactory extends HttpUrlRequestFactory { | 17 class HttpUrlConnectionUrlRequestFactory extends HttpUrlRequestFactory { |
| 18 | 18 |
| 19 private final Context mContext; | 19 private final Context mContext; |
| 20 | 20 |
| 21 public HttpUrlConnectionUrlRequestFactory( | 21 public HttpUrlConnectionUrlRequestFactory( |
| 22 Context context, UrlRequestContextConfig config) { | 22 Context context, UrlRequestContextConfig config) { |
| 23 mContext = context.getApplicationContext(); | 23 mContext = context; |
| 24 } | 24 } |
| 25 | 25 |
| 26 @Override | 26 @Override |
| 27 public boolean isEnabled() { | 27 public boolean isEnabled() { |
| 28 return true; | 28 return true; |
| 29 } | 29 } |
| 30 | 30 |
| 31 @Override | 31 @Override |
| 32 public String getName() { | 32 public String getName() { |
| 33 return "HttpUrlConnection/" + Version.getVersion(); | 33 return "HttpUrlConnection/" + Version.getVersion(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 56 out.close(); | 56 out.close(); |
| 57 } catch (IOException e) { | 57 } catch (IOException e) { |
| 58 // Ignore any exceptions. | 58 // Ignore any exceptions. |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 @Override | 62 @Override |
| 63 public void stopNetLog() { | 63 public void stopNetLog() { |
| 64 } | 64 } |
| 65 } | 65 } |
| OLD | NEW |