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

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

Issue 1096203006: Collect all ConnectionAttempts from both sockets in TransportConnectJob. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@domrel_serverip1
Patch Set: rebase Created 5 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
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 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_H_ 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_H_
6 #define NET_SOCKET_TCP_CLIENT_SOCKET_H_ 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "net/base/address_list.h" 11 #include "net/base/address_list.h"
12 #include "net/base/completion_callback.h" 12 #include "net/base/completion_callback.h"
13 #include "net/base/net_export.h" 13 #include "net/base/net_export.h"
14 #include "net/log/net_log.h" 14 #include "net/log/net_log.h"
15 #include "net/socket/connection_attempts.h"
15 #include "net/socket/stream_socket.h" 16 #include "net/socket/stream_socket.h"
16 #include "net/socket/tcp_socket.h" 17 #include "net/socket/tcp_socket.h"
17 18
18 namespace net { 19 namespace net {
19 20
20 // A client socket that uses TCP as the transport layer. 21 // A client socket that uses TCP as the transport layer.
21 class NET_EXPORT TCPClientSocket : public StreamSocket { 22 class NET_EXPORT TCPClientSocket : public StreamSocket {
22 public: 23 public:
23 // The IP address(es) and port number to connect to. The TCP socket will try 24 // The IP address(es) and port number to connect to. The TCP socket will try
24 // each IP address in the list until it succeeds in establishing a 25 // each IP address in the list until it succeeds in establishing a
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 const CompletionCallback& callback) override; 63 const CompletionCallback& callback) override;
63 int Write(IOBuffer* buf, 64 int Write(IOBuffer* buf,
64 int buf_len, 65 int buf_len,
65 const CompletionCallback& callback) override; 66 const CompletionCallback& callback) override;
66 int SetReceiveBufferSize(int32 size) override; 67 int SetReceiveBufferSize(int32 size) override;
67 int SetSendBufferSize(int32 size) override; 68 int SetSendBufferSize(int32 size) override;
68 69
69 virtual bool SetKeepAlive(bool enable, int delay); 70 virtual bool SetKeepAlive(bool enable, int delay);
70 virtual bool SetNoDelay(bool no_delay); 71 virtual bool SetNoDelay(bool no_delay);
71 72
73 void GetConnectionAttempts(ConnectionAttempts* out) const override;
74
72 private: 75 private:
73 // State machine for connecting the socket. 76 // State machine for connecting the socket.
74 enum ConnectState { 77 enum ConnectState {
75 CONNECT_STATE_CONNECT, 78 CONNECT_STATE_CONNECT,
76 CONNECT_STATE_CONNECT_COMPLETE, 79 CONNECT_STATE_CONNECT_COMPLETE,
77 CONNECT_STATE_NONE, 80 CONNECT_STATE_NONE,
78 }; 81 };
79 82
80 // State machine used by Connect(). 83 // State machine used by Connect().
81 int DoConnectLoop(int result); 84 int DoConnectLoop(int result);
(...skipping 27 matching lines...) Expand all
109 // The next state for the Connect() state machine. 112 // The next state for the Connect() state machine.
110 ConnectState next_connect_state_; 113 ConnectState next_connect_state_;
111 114
112 // This socket was previously disconnected and has not been re-connected. 115 // This socket was previously disconnected and has not been re-connected.
113 bool previously_disconnected_; 116 bool previously_disconnected_;
114 117
115 // Record of connectivity and transmissions, for use in speculative connection 118 // Record of connectivity and transmissions, for use in speculative connection
116 // histograms. 119 // histograms.
117 UseHistory use_history_; 120 UseHistory use_history_;
118 121
122 ConnectionAttempts connection_attempts_;
123
119 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); 124 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket);
120 }; 125 };
121 126
122 } // namespace net 127 } // namespace net
123 128
124 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ 129 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698