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

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: Update text 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
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 NetLog::ParametersCallback net_log_callback =
2533 base::Bind(&NetLogX509CertificateCallback,
2534 base::Unretained(nss_handshake_state_.server_cert.get()));
2535 PostOrRunCallback( 2532 PostOrRunCallback(
2536 FROM_HERE, 2533 FROM_HERE,
2537 base::Bind(&AddLogEventWithCallback, weak_net_log_, 2534 base::Bind(&AddLogEventWithCallback, weak_net_log_,
2538 NetLog::TYPE_SSL_CERTIFICATES_RECEIVED, 2535 NetLog::TYPE_SSL_CERTIFICATES_RECEIVED,
2539 net_log_callback)); 2536 CreateNetLogX509CertificateCallback(
2537 nss_handshake_state_.server_cert)));
2540 } 2538 }
2541 } 2539 }
2542 2540
2543 void SSLClientSocketNSS::Core::UpdateConnectionStatus() { 2541 void SSLClientSocketNSS::Core::UpdateConnectionStatus() {
2544 SSLChannelInfo channel_info; 2542 SSLChannelInfo channel_info;
2545 SECStatus ok = SSL_GetChannelInfo(nss_fd_, 2543 SECStatus ok = SSL_GetChannelInfo(nss_fd_,
2546 &channel_info, sizeof(channel_info)); 2544 &channel_info, sizeof(channel_info));
2547 if (ok == SECSuccess && 2545 if (ok == SECSuccess &&
2548 channel_info.length == sizeof(channel_info) && 2546 channel_info.length == sizeof(channel_info) &&
2549 channel_info.cipherSuite) { 2547 channel_info.cipherSuite) {
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
3696 EnsureThreadIdAssigned(); 3694 EnsureThreadIdAssigned();
3697 base::AutoLock auto_lock(lock_); 3695 base::AutoLock auto_lock(lock_);
3698 return valid_thread_id_ == base::PlatformThread::CurrentId(); 3696 return valid_thread_id_ == base::PlatformThread::CurrentId();
3699 } 3697 }
3700 3698
3701 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { 3699 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const {
3702 return server_bound_cert_service_; 3700 return server_bound_cert_service_;
3703 } 3701 }
3704 3702
3705 } // namespace net 3703 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698