Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: components/cronet/android/cronet_url_request_context_adapter.cc

Issue 1093793002: Allow setting Cronet NetLog level to LOG_ALL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/cronet_url_request_context_adapter.cc
diff --git a/components/cronet/android/cronet_url_request_context_adapter.cc b/components/cronet/android/cronet_url_request_context_adapter.cc
index 3ee0c7ef263aee66b854d967645dfb2e49cbe596..ec52c9a4c1721a4219f836f1ef40024629276dd0 100644
--- a/components/cronet/android/cronet_url_request_context_adapter.cc
+++ b/components/cronet/android/cronet_url_request_context_adapter.cc
@@ -271,13 +271,14 @@ CronetURLRequestContextAdapter::GetNetworkTaskRunner() const {
void CronetURLRequestContextAdapter::StartNetLogToFile(JNIEnv* env,
jobject jcaller,
- jstring jfile_name) {
+ jstring jfile_name,
+ jboolean jlog_all) {
PostTaskToNetworkThread(
FROM_HERE,
base::Bind(
&CronetURLRequestContextAdapter::StartNetLogToFileOnNetworkThread,
base::Unretained(this),
- base::android::ConvertJavaStringToUTF8(env, jfile_name)));
+ base::android::ConvertJavaStringToUTF8(env, jfile_name), jlog_all));
}
void CronetURLRequestContextAdapter::StopNetLog(JNIEnv* env, jobject jcaller) {
@@ -288,7 +289,7 @@ void CronetURLRequestContextAdapter::StopNetLog(JNIEnv* env, jobject jcaller) {
}
void CronetURLRequestContextAdapter::StartNetLogToFileOnNetworkThread(
- const std::string& file_name) {
+ const std::string& file_name, bool log_all) {
DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread());
DCHECK(is_context_initialized_);
DCHECK(context_);
@@ -301,6 +302,10 @@ void CronetURLRequestContextAdapter::StartNetLogToFileOnNetworkThread(
return;
write_to_file_observer_.reset(new net::WriteToFileNetLogObserver());
+ if (log_all) {
+ write_to_file_observer_->set_capture_mode(
+ net::NetLogCaptureMode::IncludeSocketBytes());
+ }
write_to_file_observer_->StartObserving(context_->net_log(), file.Pass(),
nullptr, context_.get());
}

Powered by Google App Engine
This is Rietveld 408576698