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

Unified Diff: google_apis/gcm/tools/mcs_probe.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: google_apis/gcm/tools/mcs_probe.cc
diff --git a/google_apis/gcm/tools/mcs_probe.cc b/google_apis/gcm/tools/mcs_probe.cc
index 7eea9a6557123ef57a7472db4afbd29e474b05fc..713980ca76501f0bba11a90ef615ebdfdd65403c 100644
--- a/google_apis/gcm/tools/mcs_probe.cc
+++ b/google_apis/gcm/tools/mcs_probe.cc
@@ -13,6 +13,7 @@
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
+#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -345,20 +346,19 @@ void MCSProbe::UpdateCallback(bool success) {
}
void MCSProbe::InitializeNetworkState() {
- FILE* log_file = NULL;
+ base::ScopedFILE log_file;
if (command_line_.HasSwitch(kLogFileSwitch)) {
base::FilePath log_path = command_line_.GetSwitchValuePath(kLogFileSwitch);
#if defined(OS_WIN)
- log_file = _wfopen(log_path.value().c_str(), L"w");
+ log_file.reset(_wfopen(log_path.value().c_str(), L"w"));
#elif defined(OS_POSIX)
- log_file = fopen(log_path.value().c_str(), "w");
+ log_file.reset(fopen(log_path.value().c_str(), "w"));
#endif
}
- if (log_file != NULL) {
- scoped_ptr<base::Value> net_constants(net::NetLogLogger::GetConstants());
- logger_.reset(new net::NetLogLogger(log_file, *net_constants));
+ if (log_file.get()) {
+ logger_.reset(new net::NetLogLogger());
logger_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES);
- logger_->StartObserving(&net_log_);
+ logger_->StartObserving(&net_log_, log_file.Pass(), nullptr, nullptr);
}
host_resolver_ = net::HostResolver::CreateDefaultResolver(&net_log_);

Powered by Google App Engine
This is Rietveld 408576698