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

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 10534117: Fix NetLog thread safety issue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Revert, swtich to const ref 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 | « no previous file | no next file » | 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 141669)
+++ net/socket/ssl_client_socket_nss.cc (working copy)
@@ -2529,9 +2529,11 @@
nss_handshake_state_.server_cert = X509Certificate::CreateFromDERCertChain(
nss_handshake_state_.server_cert_chain.AsStringPieceVector());
if (nss_handshake_state_.server_cert) {
+ // Since this will be called asynchronously on another thread, it needs to
+ // own a reference to the certificate.
NetLog::ParametersCallback net_log_callback =
base::Bind(&NetLogX509CertificateCallback,
- base::Unretained(nss_handshake_state_.server_cert.get()));
+ base::ConstRef(nss_handshake_state_.server_cert));
Ryan Sleevi 2012/06/12 21:33:26 This is still wrong. ConstRefWrapper stores a Con
PostOrRunCallback(
FROM_HERE,
base::Bind(&AddLogEventWithCallback, weak_net_log_,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698