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.Build; | 8 import android.os.Build; |
9 import android.os.ConditionVariable; | 9 import android.os.ConditionVariable; |
10 import android.os.Handler; | 10 import android.os.Handler; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // It is possible that adapter is already destroyed on another threa
d. | 115 // It is possible that adapter is already destroyed on another threa
d. |
116 if (!haveRequestContextAdapter()) { | 116 if (!haveRequestContextAdapter()) { |
117 return; | 117 return; |
118 } | 118 } |
119 nativeDestroy(mUrlRequestContextAdapter); | 119 nativeDestroy(mUrlRequestContextAdapter); |
120 mUrlRequestContextAdapter = 0; | 120 mUrlRequestContextAdapter = 0; |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 @Override | 124 @Override |
125 public void startNetLogToFile(String fileName) { | 125 public void startNetLogToFile(String fileName, boolean logAll) { |
126 synchronized (mLock) { | 126 synchronized (mLock) { |
127 checkHaveAdapter(); | 127 checkHaveAdapter(); |
128 nativeStartNetLogToFile(mUrlRequestContextAdapter, fileName); | 128 nativeStartNetLogToFile(mUrlRequestContextAdapter, fileName, |
| 129 logAll); |
129 } | 130 } |
130 } | 131 } |
131 | 132 |
132 @Override | 133 @Override |
133 public void stopNetLog() { | 134 public void stopNetLog() { |
134 synchronized (mLock) { | 135 synchronized (mLock) { |
135 checkHaveAdapter(); | 136 checkHaveAdapter(); |
136 nativeStopNetLog(mUrlRequestContextAdapter); | 137 nativeStopNetLog(mUrlRequestContextAdapter); |
137 } | 138 } |
138 } | 139 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // Native methods are implemented in cronet_url_request_context.cc. | 202 // Native methods are implemented in cronet_url_request_context.cc. |
202 private static native long nativeCreateRequestContextAdapter(String config); | 203 private static native long nativeCreateRequestContextAdapter(String config); |
203 | 204 |
204 private static native int nativeSetMinLogLevel(int loggingLevel); | 205 private static native int nativeSetMinLogLevel(int loggingLevel); |
205 | 206 |
206 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 207 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
207 private native void nativeDestroy(long nativePtr); | 208 private native void nativeDestroy(long nativePtr); |
208 | 209 |
209 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 210 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
210 private native void nativeStartNetLogToFile(long nativePtr, | 211 private native void nativeStartNetLogToFile(long nativePtr, |
211 String fileName); | 212 String fileName, boolean logAll); |
212 | 213 |
213 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 214 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
214 private native void nativeStopNetLog(long nativePtr); | 215 private native void nativeStopNetLog(long nativePtr); |
215 | 216 |
216 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 217 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
217 private native void nativeInitRequestContextOnMainThread(long nativePtr); | 218 private native void nativeInitRequestContextOnMainThread(long nativePtr); |
218 } | 219 } |
OLD | NEW |