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

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

Issue 1746012: More cleanup of net_log.h (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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/socket/ssl_client_socket_mac.cc ('k') | net/socket/ssl_client_socket_win.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 int SSLClientSocketNSS::Connect(CompletionCallback* callback) { 285 int SSLClientSocketNSS::Connect(CompletionCallback* callback) {
286 EnterFunction(""); 286 EnterFunction("");
287 DCHECK(transport_.get()); 287 DCHECK(transport_.get());
288 DCHECK(next_handshake_state_ == STATE_NONE); 288 DCHECK(next_handshake_state_ == STATE_NONE);
289 DCHECK(!user_read_callback_); 289 DCHECK(!user_read_callback_);
290 DCHECK(!user_write_callback_); 290 DCHECK(!user_write_callback_);
291 DCHECK(!user_connect_callback_); 291 DCHECK(!user_connect_callback_);
292 DCHECK(!user_read_buf_); 292 DCHECK(!user_read_buf_);
293 DCHECK(!user_write_buf_); 293 DCHECK(!user_write_buf_);
294 294
295 net_log_.BeginEvent(NetLog::TYPE_SSL_CONNECT); 295 net_log_.BeginEvent(NetLog::TYPE_SSL_CONNECT, NULL);
296 296
297 int rv = Init(); 297 int rv = Init();
298 if (rv != OK) { 298 if (rv != OK) {
299 net_log_.EndEvent(NetLog::TYPE_SSL_CONNECT); 299 net_log_.EndEvent(NetLog::TYPE_SSL_CONNECT, NULL);
300 return rv; 300 return rv;
301 } 301 }
302 302
303 rv = InitializeSSLOptions(); 303 rv = InitializeSSLOptions();
304 if (rv != OK) { 304 if (rv != OK) {
305 net_log_.EndEvent(NetLog::TYPE_SSL_CONNECT); 305 net_log_.EndEvent(NetLog::TYPE_SSL_CONNECT, NULL);
306 return rv; 306 return rv;
307 } 307 }
308 308
309 GotoState(STATE_HANDSHAKE); 309 GotoState(STATE_HANDSHAKE);
310 rv = DoHandshakeLoop(OK); 310 rv = DoHandshakeLoop(OK);
311 if (rv == ERR_IO_PENDING) { 311 if (rv == ERR_IO_PENDING) {
312 user_connect_callback_ = callback; 312 user_connect_callback_ = callback;
313 } else { 313 } else {
314 net_log_.EndEvent(NetLog::TYPE_SSL_CONNECT); 314 net_log_.EndEvent(NetLog::TYPE_SSL_CONNECT, NULL);
315 } 315 }
316 316
317 LeaveFunction(""); 317 LeaveFunction("");
318 return rv > OK ? OK : rv; 318 return rv > OK ? OK : rv;
319 } 319 }
320 320
321 int SSLClientSocketNSS::InitializeSSLOptions() { 321 int SSLClientSocketNSS::InitializeSSLOptions() {
322 // Transport connected, now hook it up to nss 322 // Transport connected, now hook it up to nss
323 // TODO(port): specify rx and tx buffer sizes separately 323 // TODO(port): specify rx and tx buffer sizes separately
324 nss_fd_ = memio_CreateIOLayer(kRecvBufferSize); 324 nss_fd_ = memio_CreateIOLayer(kRecvBufferSize);
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 CompletionCallback* c = user_connect_callback_; 810 CompletionCallback* c = user_connect_callback_;
811 user_connect_callback_ = NULL; 811 user_connect_callback_ = NULL;
812 c->Run(rv > OK ? OK : rv); 812 c->Run(rv > OK ? OK : rv);
813 LeaveFunction(""); 813 LeaveFunction("");
814 } 814 }
815 815
816 void SSLClientSocketNSS::OnHandshakeIOComplete(int result) { 816 void SSLClientSocketNSS::OnHandshakeIOComplete(int result) {
817 EnterFunction(result); 817 EnterFunction(result);
818 int rv = DoHandshakeLoop(result); 818 int rv = DoHandshakeLoop(result);
819 if (rv != ERR_IO_PENDING) { 819 if (rv != ERR_IO_PENDING) {
820 net_log_.EndEvent(net::NetLog::TYPE_SSL_CONNECT); 820 net_log_.EndEvent(net::NetLog::TYPE_SSL_CONNECT, NULL);
821 DoConnectCallback(rv); 821 DoConnectCallback(rv);
822 } 822 }
823 LeaveFunction(""); 823 LeaveFunction("");
824 } 824 }
825 825
826 void SSLClientSocketNSS::OnSendComplete(int result) { 826 void SSLClientSocketNSS::OnSendComplete(int result) {
827 EnterFunction(result); 827 EnterFunction(result);
828 if (next_handshake_state_ == STATE_HANDSHAKE) { 828 if (next_handshake_state_ == STATE_HANDSHAKE) {
829 // In handshake phase. 829 // In handshake phase.
830 OnHandshakeIOComplete(result); 830 OnHandshakeIOComplete(result);
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 PRErrorCode prerr = PR_GetError(); 1436 PRErrorCode prerr = PR_GetError();
1437 if (prerr == PR_WOULD_BLOCK_ERROR) { 1437 if (prerr == PR_WOULD_BLOCK_ERROR) {
1438 LeaveFunction(""); 1438 LeaveFunction("");
1439 return ERR_IO_PENDING; 1439 return ERR_IO_PENDING;
1440 } 1440 }
1441 LeaveFunction(""); 1441 LeaveFunction("");
1442 return MapNSPRError(prerr); 1442 return MapNSPRError(prerr);
1443 } 1443 }
1444 1444
1445 } // namespace net 1445 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_mac.cc ('k') | net/socket/ssl_client_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698