| Index: net/socket/ssl_client_socket_nss.cc
|
| ===================================================================
|
| --- net/socket/ssl_client_socket_nss.cc (revision 140753)
|
| +++ net/socket/ssl_client_socket_nss.cc (working copy)
|
| @@ -382,6 +382,17 @@
|
| CERT_DestroyCertificate(certs[i]);
|
| }
|
|
|
| +// Helper function to make it possible to log events from within the
|
| +// SSLClientSocketNSS::Core. Can't use Bind with BoundNetLog::AddEntry directly
|
| +// on Windows because it is overloaded.
|
| +void AddLogEvent(BoundNetLog* net_log,
|
| + NetLog::EventType event_type,
|
| + const scoped_refptr<NetLog::EventParameters>& event_params) {
|
| + if (!net_log)
|
| + return;
|
| + net_log->AddEvent(event_type, event_params);
|
| +}
|
| +
|
| // Helper function to make it easier to call BoundNetLog::AddByteTransferEvent
|
| // from within the SSLClientSocketNSS::Core.
|
| // AddByteTransferEvent expects to receive a const char*, which within the
|
| @@ -1262,7 +1273,7 @@
|
|
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_REQUESTED,
|
| scoped_refptr<NetLog::EventParameters>()));
|
|
|
| @@ -1309,7 +1320,7 @@
|
| // number collision. See crbug.com/97355.
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count", 0))));
|
| @@ -1332,7 +1343,7 @@
|
| CERT_DestroyCertList(cert_chain);
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count", 0))));
|
| @@ -1355,7 +1366,7 @@
|
| int cert_count = 1 + intermediates.size();
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count",
|
| @@ -1368,7 +1379,7 @@
|
| // Send no client certificate.
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count", 0))));
|
| @@ -1390,7 +1401,7 @@
|
|
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count", 0))));
|
| @@ -1535,7 +1546,7 @@
|
| }
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count",
|
| @@ -1559,7 +1570,7 @@
|
| // Send no client certificate.
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count", 0))));
|
| @@ -1614,7 +1625,7 @@
|
|
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_REQUESTED,
|
| scoped_refptr<NetLog::EventParameters>()));
|
|
|
| @@ -1646,7 +1657,7 @@
|
| // NSS will construct the certificate chain.
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count", -1))));
|
| @@ -1658,7 +1669,7 @@
|
| // Send no client certificate.
|
| core->PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, core->weak_net_log_,
|
| + base::Bind(&AddLogEvent, core->weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count", 0))));
|
| @@ -1909,7 +1920,7 @@
|
| int rv = ERR_UNEXPECTED;
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_READ_ERROR,
|
| make_scoped_refptr(new SSLErrorParams(rv, 0))));
|
| return rv;
|
| @@ -1938,7 +1949,7 @@
|
| int rv = ERR_UNEXPECTED;
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_READ_ERROR,
|
| make_scoped_refptr(new SSLErrorParams(rv, 0))));
|
| return rv;
|
| @@ -1973,7 +1984,7 @@
|
| net_error = ERR_SSL_CLIENT_AUTH_CERT_NEEDED;
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_HANDSHAKE_ERROR,
|
| make_scoped_refptr(new SSLErrorParams(net_error, 0))));
|
|
|
| @@ -1993,7 +2004,7 @@
|
| net_error = ERR_SSL_PROTOCOL_ERROR;
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_HANDSHAKE_ERROR,
|
| make_scoped_refptr(
|
| new SSLErrorParams(net_error, 0))));
|
| @@ -2054,7 +2065,7 @@
|
| } else {
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_HANDSHAKE_ERROR,
|
| make_scoped_refptr(
|
| new SSLErrorParams(net_error, prerr))));
|
| @@ -2095,7 +2106,7 @@
|
|
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count",
|
| @@ -2121,7 +2132,7 @@
|
| rv = ERR_SSL_CLIENT_AUTH_CERT_NEEDED;
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_READ_ERROR,
|
| make_scoped_refptr(new SSLErrorParams(rv, 0))));
|
| return rv;
|
| @@ -2141,7 +2152,7 @@
|
| rv = HandleNSSError(prerr, false);
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_READ_ERROR,
|
| make_scoped_refptr(new SSLErrorParams(rv, prerr))));
|
| return rv;
|
| @@ -2168,7 +2179,7 @@
|
| rv = HandleNSSError(prerr, false);
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_WRITE_ERROR,
|
| make_scoped_refptr(new SSLErrorParams(rv, prerr))));
|
| return rv;
|
| @@ -2416,7 +2427,7 @@
|
| int cert_count = (rv == SECSuccess) ? 1 : 0;
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
|
| make_scoped_refptr(
|
| new NetLogIntegerParameter("cert_count",
|
| @@ -2475,7 +2486,7 @@
|
| if (nss_handshake_state_.server_cert) {
|
| PostOrRunCallback(
|
| FROM_HERE,
|
| - base::Bind(&BoundNetLog::AddEvent, weak_net_log_,
|
| + base::Bind(&AddLogEvent, weak_net_log_,
|
| NetLog::TYPE_SSL_CERTIFICATES_RECEIVED,
|
| make_scoped_refptr(
|
| new X509CertificateNetLogParam(
|
|
|