Index: components/cronet/android/url_request_context_adapter.cc |
diff --git a/components/cronet/android/url_request_context_adapter.cc b/components/cronet/android/url_request_context_adapter.cc |
index 6ce58d06931b8992fb7f8717892ad9c146f4d05c..7c4165bc110748888bc0cdfb078b66f7e41f97cb 100644 |
--- a/components/cronet/android/url_request_context_adapter.cc |
+++ b/components/cronet/android/url_request_context_adapter.cc |
@@ -261,11 +261,12 @@ URLRequestContextAdapter::GetNetworkTaskRunner() const { |
return network_thread_->message_loop_proxy(); |
} |
-void URLRequestContextAdapter::StartNetLogToFile(const std::string& file_name) { |
+void URLRequestContextAdapter::StartNetLogToFile(const std::string& file_name, |
+ bool log_all) { |
PostTaskToNetworkThread( |
FROM_HERE, |
- base::Bind( |
- &URLRequestContextAdapter::StartNetLogToFileHelper, this, file_name)); |
+ base::Bind(&URLRequestContextAdapter::StartNetLogToFileHelper, this, |
+ file_name, log_all)); |
} |
void URLRequestContextAdapter::StopNetLog() { |
@@ -274,7 +275,7 @@ void URLRequestContextAdapter::StopNetLog() { |
} |
void URLRequestContextAdapter::StartNetLogToFileHelper( |
- const std::string& file_name) { |
+ const std::string& file_name, bool log_all) { |
DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread()); |
// Do nothing if already logging to a file. |
if (net_log_logger_) |
@@ -286,6 +287,8 @@ void URLRequestContextAdapter::StartNetLogToFileHelper( |
return; |
net_log_logger_.reset(new net::NetLogLogger()); |
+ if (log_all) |
+ net_log_logger_->set_log_level(net::NetLog::LogLevel::LOG_ALL); |
net_log_logger_->StartObserving(context_->net_log(), file.Pass(), nullptr, |
context_.get()); |
} |