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.os.Handler; | 8 import android.os.Handler; |
9 import android.os.Looper; | 9 import android.os.Looper; |
10 import android.os.Process; | 10 import android.os.Process; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 /** | 71 /** |
72 * Gets current statistics recorded since |initializeStatistics| with | 72 * Gets current statistics recorded since |initializeStatistics| with |
73 * |filter| as a substring as JSON text (an empty |filter| will include all | 73 * |filter| as a substring as JSON text (an empty |filter| will include all |
74 * registered histograms). | 74 * registered histograms). |
75 */ | 75 */ |
76 public String getStatisticsJSON(String filter) { | 76 public String getStatisticsJSON(String filter) { |
77 return nativeGetStatisticsJSON(filter); | 77 return nativeGetStatisticsJSON(filter); |
78 } | 78 } |
79 | 79 |
80 /** | 80 /** |
81 * Starts NetLog logging to a file. The NetLog capture mode is | 81 * Starts NetLog logging to a file. The NetLog capture mode is either |
82 * NetLogCaptureMode::Default(). | 82 * NetLogCaptureMode::Default() or NetLogCaptureMode::IncludeSocketBytes(). |
| 83 * The IncludeSocketBytes() mode includes basic events, user cookies, |
| 84 * credentials and all transferred bytes in the log. |
83 * @param fileName The complete file path. It must not be empty. If file | 85 * @param fileName The complete file path. It must not be empty. If file |
84 * exists, it is truncated before starting. If actively logging, | 86 * exists, it is truncated before starting. If actively logging, |
85 * this method is ignored. | 87 * this method is ignored. |
| 88 * @param logAll {@code true} to use the |
| 89 * NetLogCaptureMode::IncludeSocketBytes() logging level. If |
| 90 * false, NetLogCaptureMode::Default() is used instead. |
86 */ | 91 */ |
87 public void startNetLogToFile(String fileName) { | 92 public void startNetLogToFile(String fileName, boolean logAll) { |
88 nativeStartNetLogToFile(mChromiumUrlRequestContextAdapter, fileName); | 93 nativeStartNetLogToFile(mChromiumUrlRequestContextAdapter, fileName, |
| 94 logAll); |
89 } | 95 } |
90 | 96 |
91 /** | 97 /** |
92 * Stops NetLog logging and flushes file to disk. If a logging session is | 98 * Stops NetLog logging and flushes file to disk. If a logging session is |
93 * not in progress, this call is ignored. | 99 * not in progress, this call is ignored. |
94 */ | 100 */ |
95 public void stopNetLog() { | 101 public void stopNetLog() { |
96 nativeStopNetLog(mChromiumUrlRequestContextAdapter); | 102 nativeStopNetLog(mChromiumUrlRequestContextAdapter); |
97 } | 103 } |
98 | 104 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 String userAgent, int loggingLevel, String config); | 149 String userAgent, int loggingLevel, String config); |
144 | 150 |
145 private native void nativeReleaseRequestContextAdapter( | 151 private native void nativeReleaseRequestContextAdapter( |
146 long chromiumUrlRequestContextAdapter); | 152 long chromiumUrlRequestContextAdapter); |
147 | 153 |
148 private native void nativeInitializeStatistics(); | 154 private native void nativeInitializeStatistics(); |
149 | 155 |
150 private native String nativeGetStatisticsJSON(String filter); | 156 private native String nativeGetStatisticsJSON(String filter); |
151 | 157 |
152 private native void nativeStartNetLogToFile( | 158 private native void nativeStartNetLogToFile( |
153 long chromiumUrlRequestContextAdapter, String fileName); | 159 long chromiumUrlRequestContextAdapter, String fileName, |
| 160 boolean logAll); |
154 | 161 |
155 private native void nativeStopNetLog(long chromiumUrlRequestContextAdapter); | 162 private native void nativeStopNetLog(long chromiumUrlRequestContextAdapter); |
156 | 163 |
157 private native void nativeInitRequestContextOnMainThread( | 164 private native void nativeInitRequestContextOnMainThread( |
158 long chromiumUrlRequestContextAdapter); | 165 long chromiumUrlRequestContextAdapter); |
159 } | 166 } |
OLD | NEW |