| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 * otherwise throws an exception. | 49 * otherwise throws an exception. |
| 50 * | 50 * |
| 51 * Cannot be called on network thread - the thread Cronet calls into | 51 * Cannot be called on network thread - the thread Cronet calls into |
| 52 * Executor on (which is different from the thread the Executor invokes | 52 * Executor on (which is different from the thread the Executor invokes |
| 53 * callbacks on). May block until all the Context's resources have been | 53 * callbacks on). May block until all the Context's resources have been |
| 54 * cleaned up. | 54 * cleaned up. |
| 55 */ | 55 */ |
| 56 public abstract void shutdown(); | 56 public abstract void shutdown(); |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * Starts NetLog logging to a file. The NetLog capture mode used is | 59 * Starts NetLog logging to a file. The NetLog capture mode used is either |
| 60 * NetLogCaptureMode::Default(). | 60 * NetLogCaptureMode::Default() or NetLogCaptureMode::IncludeSocketBytes(). |
| 61 * The IncludeSocketBytes() mode includes basic events, user cookies, |
| 62 * credentials and all transferred bytes in the log. |
| 61 * @param fileName The complete file path. It must not be empty. If file | 63 * @param fileName The complete file path. It must not be empty. If file |
| 62 * exists, it is truncated before starting. If actively logging, | 64 * exists, it is truncated before starting. If actively logging, |
| 63 * this method is ignored. | 65 * this method is ignored. |
| 66 * @param logAll {@code true} to use the |
| 67 * NetLogCaptureMode::IncludeSocketBytes() logging level. If |
| 68 * false, NetLogCaptureMode::Default() is used instead. |
| 64 */ | 69 */ |
| 65 public abstract void startNetLogToFile(String fileName); | 70 public abstract void startNetLogToFile(String fileName, boolean logAll); |
| 66 | 71 |
| 67 /** | 72 /** |
| 68 * Stops NetLog logging and flushes file to disk. If a logging session is | 73 * Stops NetLog logging and flushes file to disk. If a logging session is |
| 69 * not in progress, this call is ignored. | 74 * not in progress, this call is ignored. |
| 70 */ | 75 */ |
| 71 public abstract void stopNetLog(); | 76 public abstract void stopNetLog(); |
| 72 | 77 |
| 73 /** | 78 /** |
| 74 * Create context with given config. If config.legacyMode is true, or | 79 * Create context with given config. If config.legacyMode is true, or |
| 75 * native library is not available, then creates HttpUrlConnection-based | 80 * native library is not available, then creates HttpUrlConnection-based |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } catch (ClassNotFoundException e) { | 120 } catch (ClassNotFoundException e) { |
| 116 // Leave as null. | 121 // Leave as null. |
| 117 } catch (Exception e) { | 122 } catch (Exception e) { |
| 118 throw new IllegalStateException( | 123 throw new IllegalStateException( |
| 119 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT, | 124 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT, |
| 120 e); | 125 e); |
| 121 } | 126 } |
| 122 return urlRequestContext; | 127 return urlRequestContext; |
| 123 } | 128 } |
| 124 } | 129 } |
| OLD | NEW |