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

Side by Side Diff: net/socket/ssl_client_socket_nss.cc

Issue 11689002: Fix for spdy cancelling ServerBoundCertServiceRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: NET_EXPORT the RequestHandle Created 7 years, 11 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 | « net/base/server_bound_cert_service_unittest.cc ('k') | net/spdy/spdy_stream.cc » ('j') | 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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 base::SequencedTaskRunner* nss_task_runner, 884 base::SequencedTaskRunner* nss_task_runner,
885 ClientSocketHandle* transport, 885 ClientSocketHandle* transport,
886 const HostPortPair& host_and_port, 886 const HostPortPair& host_and_port,
887 const SSLConfig& ssl_config, 887 const SSLConfig& ssl_config,
888 BoundNetLog* net_log, 888 BoundNetLog* net_log,
889 ServerBoundCertService* server_bound_cert_service) 889 ServerBoundCertService* server_bound_cert_service)
890 : detached_(false), 890 : detached_(false),
891 transport_(transport), 891 transport_(transport),
892 weak_net_log_factory_(net_log), 892 weak_net_log_factory_(net_log),
893 server_bound_cert_service_(server_bound_cert_service), 893 server_bound_cert_service_(server_bound_cert_service),
894 domain_bound_cert_request_handle_(NULL),
895 host_and_port_(host_and_port), 894 host_and_port_(host_and_port),
896 ssl_config_(ssl_config), 895 ssl_config_(ssl_config),
897 nss_fd_(NULL), 896 nss_fd_(NULL),
898 nss_bufs_(NULL), 897 nss_bufs_(NULL),
899 next_handshake_state_(STATE_NONE), 898 next_handshake_state_(STATE_NONE),
900 channel_id_xtn_negotiated_(false), 899 channel_id_xtn_negotiated_(false),
901 channel_id_needed_(false), 900 channel_id_needed_(false),
902 client_auth_cert_needed_(false), 901 client_auth_cert_needed_(false),
903 handshake_callback_called_(false), 902 handshake_callback_called_(false),
904 transport_recv_busy_(false), 903 transport_recv_busy_(false),
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 1068
1070 void SSLClientSocketNSS::Core::Detach() { 1069 void SSLClientSocketNSS::Core::Detach() {
1071 DCHECK(OnNetworkTaskRunner()); 1070 DCHECK(OnNetworkTaskRunner());
1072 1071
1073 detached_ = true; 1072 detached_ = true;
1074 transport_ = NULL; 1073 transport_ = NULL;
1075 weak_net_log_factory_.InvalidateWeakPtrs(); 1074 weak_net_log_factory_.InvalidateWeakPtrs();
1076 1075
1077 network_handshake_state_.Reset(); 1076 network_handshake_state_.Reset();
1078 1077
1079 if (domain_bound_cert_request_handle_ != NULL) { 1078 domain_bound_cert_request_handle_.Cancel();
1080 server_bound_cert_service_->CancelRequest(
1081 domain_bound_cert_request_handle_);
1082 domain_bound_cert_request_handle_ = NULL;
1083 }
1084 } 1079 }
1085 1080
1086 int SSLClientSocketNSS::Core::Read(IOBuffer* buf, int buf_len, 1081 int SSLClientSocketNSS::Core::Read(IOBuffer* buf, int buf_len,
1087 const CompletionCallback& callback) { 1082 const CompletionCallback& callback) {
1088 if (!OnNSSTaskRunner()) { 1083 if (!OnNSSTaskRunner()) {
1089 DCHECK(OnNetworkTaskRunner()); 1084 DCHECK(OnNetworkTaskRunner());
1090 DCHECK(!detached_); 1085 DCHECK(!detached_);
1091 DCHECK(transport_); 1086 DCHECK(transport_);
1092 1087
1093 bool posted = nss_task_runner_->PostTask( 1088 bool posted = nss_task_runner_->PostTask(
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 2609
2615 int rv = DoHandshakeLoop(result); 2610 int rv = DoHandshakeLoop(result);
2616 if (rv != ERR_IO_PENDING) 2611 if (rv != ERR_IO_PENDING)
2617 DoConnectCallback(rv); 2612 DoConnectCallback(rv);
2618 } 2613 }
2619 2614
2620 void SSLClientSocketNSS::Core::OnGetDomainBoundCertComplete(int result) { 2615 void SSLClientSocketNSS::Core::OnGetDomainBoundCertComplete(int result) {
2621 DVLOG(1) << __FUNCTION__ << " " << result; 2616 DVLOG(1) << __FUNCTION__ << " " << result;
2622 DCHECK(OnNetworkTaskRunner()); 2617 DCHECK(OnNetworkTaskRunner());
2623 2618
2624 domain_bound_cert_request_handle_ = NULL;
2625 OnHandshakeIOComplete(result); 2619 OnHandshakeIOComplete(result);
2626 } 2620 }
2627 2621
2628 void SSLClientSocketNSS::Core::BufferRecvComplete( 2622 void SSLClientSocketNSS::Core::BufferRecvComplete(
2629 IOBuffer* read_buffer, 2623 IOBuffer* read_buffer,
2630 int result) { 2624 int result) {
2631 DCHECK(read_buffer); 2625 DCHECK(read_buffer);
2632 2626
2633 if (!OnNSSTaskRunner()) { 2627 if (!OnNSSTaskRunner()) {
2634 if (detached_) 2628 if (detached_)
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
3460 EnsureThreadIdAssigned(); 3454 EnsureThreadIdAssigned();
3461 base::AutoLock auto_lock(lock_); 3455 base::AutoLock auto_lock(lock_);
3462 return valid_thread_id_ == base::PlatformThread::CurrentId(); 3456 return valid_thread_id_ == base::PlatformThread::CurrentId();
3463 } 3457 }
3464 3458
3465 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { 3459 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const {
3466 return server_bound_cert_service_; 3460 return server_bound_cert_service_;
3467 } 3461 }
3468 3462
3469 } // namespace net 3463 } // namespace net
OLDNEW
« no previous file with comments | « net/base/server_bound_cert_service_unittest.cc ('k') | net/spdy/spdy_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698