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

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 10539094: NetLogEventParameter to Callback refactoring 1, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove unneeded line Created 8 years, 6 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
« no previous file with comments | « net/socket/ssl_client_socket_mac.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_nss.cc
===================================================================
--- net/socket/ssl_client_socket_nss.cc (revision 141407)
+++ net/socket/ssl_client_socket_nss.cc (working copy)
@@ -385,6 +385,20 @@
// 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.
+// TODO(mmenke): Other than shutdown, NetLog is threadsafe. Figure out if this
+// is needed.
Ryan Sleevi 2012/06/12 17:14:38 This was needed because existing consumers of NetL
mmenke 2012/06/12 17:37:24 Thanks for the explanation.
+void AddLogEventWithCallback(BoundNetLog* net_log,
+ NetLog::EventType event_type,
+ const NetLog::ParametersCallback& callback) {
+ if (!net_log)
+ return;
+ net_log->AddEvent(event_type, callback);
+}
+
+// Helper functions 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.
+// TODO(mmenke): This function is deprecated, delete it.
void AddLogEvent(BoundNetLog* net_log,
NetLog::EventType event_type,
const scoped_refptr<NetLog::EventParameters>& event_params) {
@@ -2515,13 +2529,14 @@
nss_handshake_state_.server_cert = X509Certificate::CreateFromDERCertChain(
nss_handshake_state_.server_cert_chain.AsStringPieceVector());
if (nss_handshake_state_.server_cert) {
+ NetLog::ParametersCallback net_log_callback =
+ base::Bind(&NetLogX509CertificateCallback,
+ base::Unretained(nss_handshake_state_.server_cert.get()));
Ryan Sleevi 2012/06/12 17:14:38 I believe this is wrong. nss_handshake_state_ sho
eroman 2012/06/12 17:30:11 Thanks Ryan! I hadn't read this carefully, you are
mmenke 2012/06/12 17:37:24 Thanks for catching this, a clear bug. Options:
eroman 2012/06/12 17:47:52 It doesn't look like load_timing_observer actually
PostOrRunCallback(
FROM_HERE,
- base::Bind(&AddLogEvent, weak_net_log_,
+ base::Bind(&AddLogEventWithCallback, weak_net_log_,
NetLog::TYPE_SSL_CERTIFICATES_RECEIVED,
- make_scoped_refptr(
- new X509CertificateNetLogParam(
- nss_handshake_state_.server_cert))));
+ net_log_callback));
}
}
« no previous file with comments | « net/socket/ssl_client_socket_mac.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698