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

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

Issue 9958028: Add a new GetNegotiatedProtocol method to StreamSocket and implement in all subclasses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "net/socket/tcp_client_socket.h" 5 #include "net/socket/tcp_client_socket.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <netdb.h> 9 #include <netdb.h>
10 #include <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 545
546 bool TCPClientSocketLibevent::SetSendBufferSize(int32 size) { 546 bool TCPClientSocketLibevent::SetSendBufferSize(int32 size) {
547 DCHECK(CalledOnValidThread()); 547 DCHECK(CalledOnValidThread());
548 int rv = setsockopt(socket_, SOL_SOCKET, SO_SNDBUF, 548 int rv = setsockopt(socket_, SOL_SOCKET, SO_SNDBUF,
549 reinterpret_cast<const char*>(&size), 549 reinterpret_cast<const char*>(&size),
550 sizeof(size)); 550 sizeof(size));
551 DCHECK(!rv) << "Could not set socket send buffer size: " << errno; 551 DCHECK(!rv) << "Could not set socket send buffer size: " << errno;
552 return rv == 0; 552 return rv == 0;
553 } 553 }
554 554
555 NextProto TCPClientSocketLibevent::GetNegotiatedProtocol() const {
wtc 2012/03/30 21:19:14 Nit: define this after the GetConnectTimeMicros()
Ryan Hamilton 2012/03/30 21:53:17 Done.
556 return kProtoUnknown;
557 }
558
555 void TCPClientSocketLibevent::LogConnectCompletion(int net_error) { 559 void TCPClientSocketLibevent::LogConnectCompletion(int net_error) {
556 if (net_error == OK) 560 if (net_error == OK)
557 UpdateConnectionTypeHistograms(CONNECTION_ANY); 561 UpdateConnectionTypeHistograms(CONNECTION_ANY);
558 562
559 if (net_error != OK) { 563 if (net_error != OK) {
560 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_TCP_CONNECT, net_error); 564 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_TCP_CONNECT, net_error);
561 return; 565 return;
562 } 566 }
563 567
564 struct sockaddr_storage source_address; 568 struct sockaddr_storage source_address;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 731
728 int64 TCPClientSocketLibevent::NumBytesRead() const { 732 int64 TCPClientSocketLibevent::NumBytesRead() const {
729 return num_bytes_read_; 733 return num_bytes_read_;
730 } 734 }
731 735
732 base::TimeDelta TCPClientSocketLibevent::GetConnectTimeMicros() const { 736 base::TimeDelta TCPClientSocketLibevent::GetConnectTimeMicros() const {
733 return connect_time_micros_; 737 return connect_time_micros_;
734 } 738 }
735 739
736 } // namespace net 740 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698