Chromium Code Reviews| Index: chrome/browser/io_thread.cc |
| diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc |
| index 952964b1b79a7b16d32de582d06b4334a6b7086f..7f0948234e28a0af16c052c1b88f6faddaf424de 100644 |
| --- a/chrome/browser/io_thread.cc |
| +++ b/chrome/browser/io_thread.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/command_line.h" |
| #include "base/compiler_specific.h" |
| #include "base/debug/leak_tracker.h" |
| +#include "base/environment.h" |
| #include "base/logging.h" |
| #include "base/metrics/field_trial.h" |
| #include "base/prefs/pref_registry_simple.h" |
| @@ -80,6 +81,7 @@ |
| #include "net/quic/crypto/crypto_protocol.h" |
| #include "net/quic/quic_protocol.h" |
| #include "net/quic/quic_utils.h" |
| +#include "net/socket/ssl_client_socket.h" |
| #include "net/socket/tcp_client_socket.h" |
| #include "net/spdy/spdy_session.h" |
| #include "net/ssl/channel_id_service.h" |
| @@ -553,6 +555,35 @@ void IOThread::Init() { |
| const base::CommandLine& command_line = |
| *base::CommandLine::ForCurrentProcess(); |
|
davidben
2015/10/15 16:46:00
Optional: I probably wouldn't bother trying to log
Zhongyi Shi
2015/10/15 19:03:05
Done.
|
| + std::string env_ssl_keylog_file; |
| + scoped_ptr<base::Environment> env(base::Environment::Create()); |
| + env->GetVar("SSLKEYLOGFILE", &env_ssl_keylog_file); |
| + |
| + std::string flag_ssl_keylog_file; |
| + if (command_line.HasSwitch(switches::kSSLKeyLogFile)) { |
| + flag_ssl_keylog_file = command_line.GetSwitchValueASCII( |
| + switches::kSSLKeyLogFile); |
| + if (flag_ssl_keylog_file.empty()) { |
| + LOG(WARNING) << "ssl-key-log-file argument missing, ignored."; |
| + } |
| + } |
| + |
| + if (!flag_ssl_keylog_file.empty() && !env_ssl_keylog_file.empty()) { |
| + LOG(WARNING) << |
| + "SSLKEYLOGFILE and ssl-key-log-file both set, SSLKEYLOGFILE ignored"; |
| + } |
| + |
| + const std::string ssl_keylog_file = |
|
Bryan McQuade
2015/10/15 02:09:47
if possible, this should be const std::string& to
|
| + !flag_ssl_keylog_file.empty() ? flag_ssl_keylog_file : env_ssl_keylog_file; |
| + |
| + if (!ssl_keylog_file.empty()) { |
| + #if defined(USE_OPENSSL) |
|
davidben
2015/10/15 16:46:00
You can remove this. I'm pretty sure anything usin
Zhongyi Shi
2015/10/15 19:03:05
Done.
|
| + net::SSLClientSocket::SetSSLKeyLogFile(ssl_keylog_file); |
| + #else |
| + DVLOG(1) << "Platform does not support openssl"; |
| + #endif |
| + } |
| + |
| DCHECK(!globals_); |
| globals_ = new Globals; |