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(). |
mef
2015/05/06 21:47:28
I would explicitly specify that IncludeSocketBytes
kallasjoki
2015/05/07 10:51:27
Done.
| |
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 | |
65 * NetLogCaptureMode::IncludeSocketBytes() logging level. If | |
66 * false, NetLogCaptureMode::Default() is used instead. | |
64 */ | 67 */ |
65 public abstract void startNetLogToFile(String fileName); | 68 public abstract void startNetLogToFile(String fileName, boolean logAll); |
66 | 69 |
67 /** | 70 /** |
68 * Stops NetLog logging and flushes file to disk. If a logging session is | 71 * Stops NetLog logging and flushes file to disk. If a logging session is |
69 * not in progress, this call is ignored. | 72 * not in progress, this call is ignored. |
70 */ | 73 */ |
71 public abstract void stopNetLog(); | 74 public abstract void stopNetLog(); |
72 | 75 |
73 /** | 76 /** |
74 * Create context with given config. If config.legacyMode is true, or | 77 * Create context with given config. If config.legacyMode is true, or |
75 * native library is not available, then creates HttpUrlConnection-based | 78 * 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) { | 118 } catch (ClassNotFoundException e) { |
116 // Leave as null. | 119 // Leave as null. |
117 } catch (Exception e) { | 120 } catch (Exception e) { |
118 throw new IllegalStateException( | 121 throw new IllegalStateException( |
119 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT, | 122 "Cannot instantiate: " + CRONET_URL_REQUEST_CONTEXT, |
120 e); | 123 e); |
121 } | 124 } |
122 return urlRequestContext; | 125 return urlRequestContext; |
123 } | 126 } |
124 } | 127 } |
OLD | NEW |