| Index: chrome/browser/net/net_log_temp_file.cc
|
| diff --git a/chrome/browser/net/net_log_temp_file.cc b/chrome/browser/net/net_log_temp_file.cc
|
| index 5fcae65619691e381d3e2205e39e5adbaad0f1f8..e6df275bbe695db198507ebf58693705c5ae12b2 100644
|
| --- a/chrome/browser/net/net_log_temp_file.cc
|
| +++ b/chrome/browser/net/net_log_temp_file.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/net/net_log_temp_file.h"
|
|
|
| #include "base/files/file_util.h"
|
| +#include "base/files/scoped_file.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/net/chrome_net_log.h"
|
| #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
|
| @@ -22,7 +23,7 @@ NetLogTempFile::NetLogTempFile(ChromeNetLog* chrome_net_log)
|
|
|
| NetLogTempFile::~NetLogTempFile() {
|
| if (net_log_logger_)
|
| - net_log_logger_->StopObserving();
|
| + net_log_logger_->StopObserving(nullptr);
|
| }
|
|
|
| void NetLogTempFile::ProcessCommand(Command command) {
|
| @@ -114,12 +115,12 @@ void NetLogTempFile::StartNetLog(bool strip_private_data) {
|
| // Try to make sure we can create the file.
|
| // TODO(rtenneti): Find a better for doing the following. Surface some error
|
| // to the user if we couldn't create the file.
|
| - FILE* file = base::OpenFile(log_path_, "w");
|
| - if (file == NULL)
|
| + base::ScopedFILE file(base::OpenFile(log_path_, "w"));
|
| + if (!file)
|
| return;
|
|
|
| scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants());
|
| - net_log_logger_.reset(new net::NetLogLogger(file, *constants));
|
| + net_log_logger_.reset(new net::NetLogLogger());
|
| if (strip_private_data) {
|
| net_log_logger_->set_log_level(net::NetLog::LOG_STRIP_PRIVATE_DATA);
|
| log_type_ = LOG_TYPE_STRIP_PRIVATE_DATA;
|
| @@ -127,7 +128,8 @@ void NetLogTempFile::StartNetLog(bool strip_private_data) {
|
| net_log_logger_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES);
|
| log_type_ = LOG_TYPE_NORMAL;
|
| }
|
| - net_log_logger_->StartObserving(chrome_net_log_);
|
| + net_log_logger_->StartObserving(chrome_net_log_, file.Pass(), constants.get(),
|
| + nullptr);
|
| state_ = STATE_LOGGING;
|
| }
|
|
|
| @@ -136,7 +138,7 @@ void NetLogTempFile::StopNetLog() {
|
| if (state_ != STATE_LOGGING)
|
| return;
|
|
|
| - net_log_logger_->StopObserving();
|
| + net_log_logger_->StopObserving(nullptr);
|
| net_log_logger_.reset();
|
| state_ = STATE_NOT_LOGGING;
|
| }
|
|
|