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

Side by Side Diff: chrome/browser/net/chrome_net_log.cc

Issue 1079163007: net_log_logger_ replaced with write_to_file_observer_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: net_log_logger_ replaced with write_to_file_observer_ Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/net/chrome_net_log.h ('k') | chrome/browser/net/net_log_temp_file.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/net/chrome_net_log.h" 5 #include "chrome/browser/net/chrome_net_log.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/scoped_file.h" 10 #include "base/files/scoped_file.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 file.reset(_wfopen(log_path.value().c_str(), L"w")); 76 file.reset(_wfopen(log_path.value().c_str(), L"w"));
77 #elif defined(OS_POSIX) 77 #elif defined(OS_POSIX)
78 file.reset(fopen(log_path.value().c_str(), "w")); 78 file.reset(fopen(log_path.value().c_str(), "w"));
79 #endif 79 #endif
80 80
81 if (!file) { 81 if (!file) {
82 LOG(ERROR) << "Could not open file " << log_path.value() 82 LOG(ERROR) << "Could not open file " << log_path.value()
83 << " for net logging"; 83 << " for net logging";
84 } else { 84 } else {
85 scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants()); 85 scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants());
86 net_log_logger_.reset(new net::WriteToFileNetLogObserver()); 86 write_to_file_observer_.reset(new net::WriteToFileNetLogObserver());
87 87
88 net::NetLogCaptureMode capture_mode = 88 net::NetLogCaptureMode capture_mode =
89 GetCaptureModeFromCommandLine(command_line); 89 GetCaptureModeFromCommandLine(command_line);
90 net_log_logger_->set_capture_mode(capture_mode); 90 write_to_file_observer_->set_capture_mode(capture_mode);
91 91
92 net_log_logger_->StartObserving(this, file.Pass(), constants.get(), 92 write_to_file_observer_->StartObserving(this, file.Pass(),
93 nullptr); 93 constants.get(), nullptr);
94 } 94 }
95 } 95 }
96 96
97 trace_net_log_observer_.reset(new net::TraceNetLogObserver()); 97 trace_net_log_observer_.reset(new net::TraceNetLogObserver());
98 trace_net_log_observer_->WatchForTraceStart(this); 98 trace_net_log_observer_->WatchForTraceStart(this);
99 } 99 }
100 100
101 ChromeNetLog::~ChromeNetLog() { 101 ChromeNetLog::~ChromeNetLog() {
102 net_log_temp_file_.reset(); 102 net_log_temp_file_.reset();
103 // Remove the observers we own before we're destroyed. 103 // Remove the observers we own before we're destroyed.
104 if (net_log_logger_) 104 if (write_to_file_observer_)
105 net_log_logger_->StopObserving(nullptr); 105 write_to_file_observer_->StopObserving(nullptr);
106 if (trace_net_log_observer_) 106 if (trace_net_log_observer_)
107 trace_net_log_observer_->StopWatchForTraceStart(); 107 trace_net_log_observer_->StopWatchForTraceStart();
108 } 108 }
109 109
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_net_log.h ('k') | chrome/browser/net/net_log_temp_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698