| 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 log level used is | 59 * Starts NetLog logging to a file. The NetLog log level used is either |
| 60 * LOG_ALL_BUT_BYTES. | 60 * LOG_STRIP_PRIVATE_DATA or LOG_ALL. |
| 61 * @param fileName The complete file path. It must not be empty. If file | 61 * @param fileName The complete file path. It must not be empty. If file |
| 62 * exists, it is truncated before starting. If actively logging, | 62 * exists, it is truncated before starting. If actively logging, |
| 63 * this method is ignored. | 63 * this method is ignored. |
| 64 * @param logAll {@code true} to use the LOG_ALL logging level. If false, |
| 65 * LOG_STRIP_PRIVATE_DATA is used instead. |
| 64 */ | 66 */ |
| 65 public abstract void startNetLogToFile(String fileName); | 67 public abstract void startNetLogToFile(String fileName, boolean logAll); |
| 66 | 68 |
| 67 /** | 69 /** |
| 68 * Stops NetLog logging and flushes file to disk. If a logging session is | 70 * Stops NetLog logging and flushes file to disk. If a logging session is |
| 69 * not in progress, this call is ignored. | 71 * not in progress, this call is ignored. |
| 70 */ | 72 */ |
| 71 public abstract void stopNetLog(); | 73 public abstract void stopNetLog(); |
| 72 | 74 |
| 73 /** | 75 /** |
| 74 * Create context with given config. If config.legacyMode is true, or | 76 * Create context with given config. If config.legacyMode is true, or |
| 75 * native library is not available, then creates HttpUrlConnection-based | 77 * 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) { | 117 } catch (ClassNotFoundException e) { |
| 116 // Leave as null. | 118 // Leave as null. |
| 117 } catch (Exception e) { | 119 } catch (Exception e) { |
| 118 throw new IllegalStateException( | 120 throw new IllegalStateException( |
| 119 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT, | 121 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT, |
| 120 e); | 122 e); |
| 121 } | 123 } |
| 122 return urlRequestContext; | 124 return urlRequestContext; |
| 123 } | 125 } |
| 124 } | 126 } |
| OLD | NEW |