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

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: Merge Created 5 years, 9 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 f59b5546db06ac06b1c0b980a1858bc8ea9f0575..d21b0597e7aab99ccf1e69c6d1a91db92a4f3845 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) {
@@ -135,17 +136,18 @@ void NetLogTempFile::StartNetLog(LogType log_type) {
// 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;
log_type_ = log_type;
state_ = STATE_LOGGING;
scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants());
- net_log_logger_.reset(new net::NetLogLogger(file, *constants));
+ net_log_logger_.reset(new net::NetLogLogger());
net_log_logger_->set_log_level(GetLogLevelForLogType(log_type));
- net_log_logger_->StartObserving(chrome_net_log_);
+ net_log_logger_->StartObserving(chrome_net_log_, file.Pass(), constants.get(),
+ nullptr);
}
void NetLogTempFile::StopNetLog() {
@@ -153,7 +155,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;
}
« no previous file with comments | « chrome/browser/net/chrome_net_log.cc ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698