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

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

Issue 612023003: Make --log-net-log and NetLogLogger hide cookies by default, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix new test Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/net_log_temp_file.h" 5 #include "chrome/browser/net/net_log_temp_file.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/net/chrome_net_log.h" 9 #include "chrome/browser/net/chrome_net_log.h"
10 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" 10 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 FILE* file = base::OpenFile(log_path_, "w"); 117 FILE* file = base::OpenFile(log_path_, "w");
118 if (file == NULL) 118 if (file == NULL)
119 return; 119 return;
120 120
121 scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants()); 121 scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants());
122 net_log_logger_.reset(new net::NetLogLogger(file, *constants)); 122 net_log_logger_.reset(new net::NetLogLogger(file, *constants));
123 if (strip_private_data) { 123 if (strip_private_data) {
124 net_log_logger_->set_log_level(net::NetLog::LOG_STRIP_PRIVATE_DATA); 124 net_log_logger_->set_log_level(net::NetLog::LOG_STRIP_PRIVATE_DATA);
125 log_type_ = LOG_TYPE_STRIP_PRIVATE_DATA; 125 log_type_ = LOG_TYPE_STRIP_PRIVATE_DATA;
126 } else { 126 } else {
127 net_log_logger_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES);
127 log_type_ = LOG_TYPE_NORMAL; 128 log_type_ = LOG_TYPE_NORMAL;
128 } 129 }
129 net_log_logger_->StartObserving(chrome_net_log_); 130 net_log_logger_->StartObserving(chrome_net_log_);
130 state_ = STATE_LOGGING; 131 state_ = STATE_LOGGING;
131 } 132 }
132 133
133 void NetLogTempFile::StopNetLog() { 134 void NetLogTempFile::StopNetLog() {
134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING)); 135 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING));
135 if (state_ != STATE_LOGGING) 136 if (state_ != STATE_LOGGING)
136 return; 137 return;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 bool NetLogTempFile::GetNetExportLogDirectory(base::FilePath* path) { 173 bool NetLogTempFile::GetNetExportLogDirectory(base::FilePath* path) {
173 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING)); 174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING));
174 return base::GetTempDir(path); 175 return base::GetTempDir(path);
175 } 176 }
176 177
177 bool NetLogTempFile::NetExportLogExists() { 178 bool NetLogTempFile::NetExportLogExists() {
178 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING)); 179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING));
179 DCHECK(!log_path_.empty()); 180 DCHECK(!log_path_.empty());
180 return base::PathExists(log_path_); 181 return base::PathExists(log_path_);
181 } 182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698