| 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 8679594cff524711fc0096cfe3c7eafc53f7ee02..843d9a97d0e09600dc911358f3795321dbb72b24 100644
|
| --- a/components/cronet/android/cronet_url_request_context_adapter.cc
|
| +++ b/components/cronet/android/cronet_url_request_context_adapter.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/android/jni_string.h"
|
| #include "base/bind.h"
|
| #include "base/files/file_util.h"
|
| +#include "base/files/scoped_file.h"
|
| #include "base/logging.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/values.h"
|
| @@ -285,21 +286,20 @@ void CronetURLRequestContextAdapter::StartNetLogToFileOnNetworkThread(
|
| // Do nothing if already logging to a file.
|
| if (net_log_logger_)
|
| return;
|
| -
|
| base::FilePath file_path(file_name);
|
| - FILE* file = base::OpenFile(file_path, "w");
|
| + base::ScopedFILE file(base::OpenFile(file_path, "w"));
|
| if (!file)
|
| return;
|
|
|
| - scoped_ptr<base::Value> constants(net::NetLogLogger::GetConstants());
|
| - net_log_logger_.reset(new net::NetLogLogger(file, *constants));
|
| - net_log_logger_->StartObserving(context_->net_log());
|
| + net_log_logger_.reset(new net::NetLogLogger());
|
| + net_log_logger_->StartObserving(context_->net_log(), file.Pass(), nullptr,
|
| + context_.get());
|
| }
|
|
|
| void CronetURLRequestContextAdapter::StopNetLogOnNetworkThread() {
|
| DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread());
|
| if (net_log_logger_) {
|
| - net_log_logger_->StopObserving();
|
| + net_log_logger_->StopObserving(context_.get());
|
| net_log_logger_.reset();
|
| }
|
| }
|
|
|