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

Side by Side Diff: net/socket/client_socket.h

Issue 6800009: Attn: Mike Belshe Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 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) 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 #ifndef NET_SOCKET_CLIENT_SOCKET_H_ 5 #ifndef NET_SOCKET_CLIENT_SOCKET_H_
6 #define NET_SOCKET_CLIENT_SOCKET_H_ 6 #define NET_SOCKET_CLIENT_SOCKET_H_
7 #pragma once 7 #pragma once
8 8
9 #include <netinet/in.h>
10
9 #include "net/base/net_log.h" 11 #include "net/base/net_log.h"
10 #include "net/socket/socket.h" 12 #include "net/socket/socket.h"
11 13
12 namespace net { 14 namespace net {
13 15
14 class AddressList; 16 class AddressList;
15 17
16 class ClientSocket : public Socket { 18 class ClientSocket : public Socket {
17 public: 19 public:
18 virtual ~ClientSocket() {} 20 virtual ~ClientSocket() {}
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 68
67 // Returns true if the underlying transport socket ever had any reads or 69 // Returns true if the underlying transport socket ever had any reads or
68 // writes. ClientSockets layered on top of transport sockets should forward 70 // writes. ClientSockets layered on top of transport sockets should forward
69 // this call to the transport socket. 71 // this call to the transport socket.
70 virtual bool WasEverUsed() const = 0; 72 virtual bool WasEverUsed() const = 0;
71 73
72 // Returns true if the underlying transport socket is using TCP FastOpen. 74 // Returns true if the underlying transport socket is using TCP FastOpen.
73 // TCP FastOpen is an experiment with sending data in the TCP SYN packet. 75 // TCP FastOpen is an experiment with sending data in the TCP SYN packet.
74 virtual bool UsingTCPFastOpen() const = 0; 76 virtual bool UsingTCPFastOpen() const = 0;
75 77
78 // Returns the underlying transport socket's protocol.
79 virtual int protocol() { return IPPROTO_TCP; }
Mike Belshe 2011/04/06 18:32:53 The protocol is good, lets put that into another C
80
81 // Returns true if the underlying socket's transport protocol is SCTP and SPDY
82 // control frames are sent on SCTP stream 0.
83 virtual bool using_sctp_control_stream() { return false; }
84
Mike Belshe 2011/04/06 18:32:53 will revisit.... don't want to expose these in Cl
85 // Maps a SPDY stream number to an SCTP stream ID.
86 virtual uint16 MapSpdyToSctp(uint32 stream_id) {
87 return 0;
88 }
89
76 protected: 90 protected:
77 // The following class is only used to gather statistics about the history of 91 // The following class is only used to gather statistics about the history of
78 // a socket. It is only instantiated and used in basic sockets, such as 92 // a socket. It is only instantiated and used in basic sockets, such as
79 // TCPClientSocket* instances. Other classes that are derived from 93 // TCPClientSocket* instances. Other classes that are derived from
80 // ClientSocket should forward any potential settings to their underlying 94 // ClientSocket should forward any potential settings to their underlying
81 // transport sockets. 95 // transport sockets.
82 class UseHistory { 96 class UseHistory {
83 public: 97 public:
84 UseHistory(); 98 UseHistory();
85 ~UseHistory(); 99 ~UseHistory();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Logs a SOCKET_BYTES_RECEIVED or SOCKET_BYTES_SENT event to the NetLog. 132 // Logs a SOCKET_BYTES_RECEIVED or SOCKET_BYTES_SENT event to the NetLog.
119 // Determines whether to log the received bytes or not, based on the current 133 // Determines whether to log the received bytes or not, based on the current
120 // logging level. 134 // logging level.
121 void LogByteTransfer(const BoundNetLog& net_log, NetLog::EventType event_type, 135 void LogByteTransfer(const BoundNetLog& net_log, NetLog::EventType event_type,
122 int byte_count, char* bytes) const; 136 int byte_count, char* bytes) const;
123 }; 137 };
124 138
125 } // namespace net 139 } // namespace net
126 140
127 #endif // NET_SOCKET_CLIENT_SOCKET_H_ 141 #endif // NET_SOCKET_CLIENT_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698