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

Unified Diff: chrome/browser/net/net_log_temp_file.cc

Issue 976483002: Add ability for NetLogLogger to gather data from more than just NetLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments Created 5 years, 10 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: 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..9744bcc1b9869ac5fab327eb58d095d393fafa88 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"
@@ -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;
}

Powered by Google App Engine
This is Rietveld 408576698