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; |
| 10 import java.io.PrintWriter; |
9 import java.nio.channels.WritableByteChannel; | 11 import java.nio.channels.WritableByteChannel; |
10 import java.util.Map; | 12 import java.util.Map; |
11 | 13 |
12 /** | 14 /** |
13 * Network request using {@link java.net.HttpURLConnection}. | 15 * Network request using {@link java.net.HttpURLConnection}. |
14 */ | 16 */ |
15 class HttpUrlConnectionUrlRequestFactory extends HttpUrlRequestFactory { | 17 class HttpUrlConnectionUrlRequestFactory extends HttpUrlRequestFactory { |
16 | 18 |
17 private final Context mContext; | 19 private final Context mContext; |
18 | 20 |
(...skipping 19 matching lines...) Expand all Loading... |
38 headers, listener); | 40 headers, listener); |
39 } | 41 } |
40 | 42 |
41 @Override | 43 @Override |
42 public HttpUrlRequest createRequest(String url, int requestPriority, | 44 public HttpUrlRequest createRequest(String url, int requestPriority, |
43 Map<String, String> headers, WritableByteChannel channel, | 45 Map<String, String> headers, WritableByteChannel channel, |
44 HttpUrlRequestListener listener) { | 46 HttpUrlRequestListener listener) { |
45 return new HttpUrlConnectionUrlRequest(mContext, url, requestPriority, | 47 return new HttpUrlConnectionUrlRequest(mContext, url, requestPriority, |
46 headers, channel, listener); | 48 headers, channel, listener); |
47 } | 49 } |
| 50 |
| 51 @Override |
| 52 public void startNetLogToFile(String fileName) { |
| 53 try { |
| 54 PrintWriter out = new PrintWriter(fileName); |
| 55 out.println("NetLog is not supported by " + getName()); |
| 56 out.close(); |
| 57 } catch (IOException e) { |
| 58 // Ignore any exceptions. |
| 59 } |
| 60 } |
| 61 |
| 62 @Override |
| 63 public void stopNetLog() { |
| 64 } |
48 } | 65 } |
OLD | NEW |