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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived
6 // from AuthCertificateCallback() in 6 // from AuthCertificateCallback() in
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp.
8 8
9 /* ***** BEGIN LICENSE BLOCK ***** 9 /* ***** BEGIN LICENSE BLOCK *****
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
(...skipping 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2522 } 2522 }
2523 2523
2524 return OK; 2524 return OK;
2525 } 2525 }
2526 2526
2527 void SSLClientSocketNSS::Core::UpdateServerCert() { 2527 void SSLClientSocketNSS::Core::UpdateServerCert() {
2528 nss_handshake_state_.server_cert_chain.Reset(nss_fd_); 2528 nss_handshake_state_.server_cert_chain.Reset(nss_fd_);
2529 nss_handshake_state_.server_cert = X509Certificate::CreateFromDERCertChain( 2529 nss_handshake_state_.server_cert = X509Certificate::CreateFromDERCertChain(
2530 nss_handshake_state_.server_cert_chain.AsStringPieceVector()); 2530 nss_handshake_state_.server_cert_chain.AsStringPieceVector());
2531 if (nss_handshake_state_.server_cert) { 2531 if (nss_handshake_state_.server_cert) {
2532 // Since this will be called asynchronously on another thread, it needs to
2533 // own a reference to the certificate.
2532 NetLog::ParametersCallback net_log_callback = 2534 NetLog::ParametersCallback net_log_callback =
2533 base::Bind(&NetLogX509CertificateCallback, 2535 base::Bind(&NetLogX509CertificateCallback,
2534 base::Unretained(nss_handshake_state_.server_cert.get())); 2536 base::ConstRef(nss_handshake_state_.server_cert));
Ryan Sleevi 2012/06/12 21:33:26 This is still wrong. ConstRefWrapper stores a Con
2535 PostOrRunCallback( 2537 PostOrRunCallback(
2536 FROM_HERE, 2538 FROM_HERE,
2537 base::Bind(&AddLogEventWithCallback, weak_net_log_, 2539 base::Bind(&AddLogEventWithCallback, weak_net_log_,
2538 NetLog::TYPE_SSL_CERTIFICATES_RECEIVED, 2540 NetLog::TYPE_SSL_CERTIFICATES_RECEIVED,
2539 net_log_callback)); 2541 net_log_callback));
2540 } 2542 }
2541 } 2543 }
2542 2544
2543 void SSLClientSocketNSS::Core::UpdateConnectionStatus() { 2545 void SSLClientSocketNSS::Core::UpdateConnectionStatus() {
2544 SSLChannelInfo channel_info; 2546 SSLChannelInfo channel_info;
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
3696 EnsureThreadIdAssigned(); 3698 EnsureThreadIdAssigned();
3697 base::AutoLock auto_lock(lock_); 3699 base::AutoLock auto_lock(lock_);
3698 return valid_thread_id_ == base::PlatformThread::CurrentId(); 3700 return valid_thread_id_ == base::PlatformThread::CurrentId();
3699 } 3701 }
3700 3702
3701 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { 3703 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const {
3702 return server_bound_cert_service_; 3704 return server_bound_cert_service_;
3703 } 3705 }
3704 3706
3705 } // namespace net 3707 } // namespace net
OLDNEW
« 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