Chromium Code Reviews| 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 import android.util.Log; | 8 import android.util.Log; |
| 9 | 9 |
| 10 import java.lang.reflect.Constructor; | 10 import java.lang.reflect.Constructor; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 */ | 57 */ |
| 58 public abstract HttpUrlRequest createRequest(String url, | 58 public abstract HttpUrlRequest createRequest(String url, |
| 59 int requestPriority, Map<String, String> headers, | 59 int requestPriority, Map<String, String> headers, |
| 60 WritableByteChannel channel, HttpUrlRequestListener listener); | 60 WritableByteChannel channel, HttpUrlRequestListener listener); |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * Starts NetLog logging to a file named |fileName| in the | 63 * Starts NetLog logging to a file named |fileName| in the |
| 64 * application temporary directory. |fileName| must not be empty. Log may | 64 * application temporary directory. |fileName| must not be empty. Log may |
| 65 * contain user's personal information (PII). If the file exists it is | 65 * contain user's personal information (PII). If the file exists it is |
| 66 * truncated before starting. If actively logging the call is ignored. | 66 * truncated before starting. If actively logging the call is ignored. |
| 67 * @param fileName The complete file path. It must not be empty. If file | |
| 68 * exists, it is truncated before starting. | |
| 69 * @param logAll {@code true} to also include all transferred bytes in the | |
| 70 * log. | |
| 67 */ | 71 */ |
| 68 public abstract void startNetLogToFile(String fileName); | 72 public abstract void startNetLogToFile(String fileName, boolean logAll); |
|
miloslav
2015/04/17 14:15:03
Would making this an int (the actual log level pas
eroman
2015/04/17 21:35:10
I am in favor of a boolean rather than an integer.
kallasjoki
2015/05/06 13:58:57
I've kept it as the boolean default-or-all choice,
| |
| 69 | 73 |
| 70 /** | 74 /** |
| 71 * Stops NetLog logging and flushes file to disk. If a logging session is | 75 * Stops NetLog logging and flushes file to disk. If a logging session is |
| 72 * not in progress this call is ignored. | 76 * not in progress this call is ignored. |
| 73 */ | 77 */ |
| 74 public abstract void stopNetLog(); | 78 public abstract void stopNetLog(); |
| 75 | 79 |
| 76 private static HttpUrlRequestFactory createChromiumFactory( | 80 private static HttpUrlRequestFactory createChromiumFactory( |
| 77 Context context, UrlRequestContextConfig config) { | 81 Context context, UrlRequestContextConfig config) { |
| 78 HttpUrlRequestFactory factory = null; | 82 HttpUrlRequestFactory factory = null; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 92 } catch (ClassNotFoundException e) { | 96 } catch (ClassNotFoundException e) { |
| 93 // Leave as null | 97 // Leave as null |
| 94 } catch (Exception e) { | 98 } catch (Exception e) { |
| 95 throw new IllegalStateException( | 99 throw new IllegalStateException( |
| 96 "Cannot instantiate: " + CHROMIUM_URL_REQUEST_FACTORY, | 100 "Cannot instantiate: " + CHROMIUM_URL_REQUEST_FACTORY, |
| 97 e); | 101 e); |
| 98 } | 102 } |
| 99 return factory; | 103 return factory; |
| 100 } | 104 } |
| 101 } | 105 } |
| OLD | NEW |