Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SOCKET_LIBEVENT_H_ | 5 #ifndef NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
| 6 #define NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ | 6 #define NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 IPEndPoint* address, | 141 IPEndPoint* address, |
| 142 int rv); | 142 int rv); |
| 143 int BuildTcpSocketLibevent(scoped_ptr<TCPSocketLibevent>* tcp_socket, | 143 int BuildTcpSocketLibevent(scoped_ptr<TCPSocketLibevent>* tcp_socket, |
| 144 IPEndPoint* address); | 144 IPEndPoint* address); |
| 145 | 145 |
| 146 void ConnectCompleted(const CompletionCallback& callback, int rv) const; | 146 void ConnectCompleted(const CompletionCallback& callback, int rv) const; |
| 147 int HandleConnectCompleted(int rv) const; | 147 int HandleConnectCompleted(int rv) const; |
| 148 void LogConnectBegin(const AddressList& addresses) const; | 148 void LogConnectBegin(const AddressList& addresses) const; |
| 149 void LogConnectEnd(int net_error) const; | 149 void LogConnectEnd(int net_error) const; |
| 150 | 150 |
| 151 void ReadCompleted(IOBuffer* buf, | 151 // Binds with scoped_refptr<IOBuffer> instead of IOBuffer* to make sure buf |
| 152 // alive when this callback is called. | |
| 153 void ReadCompleted(scoped_refptr<IOBuffer> buf, | |
| 152 const CompletionCallback& callback, | 154 const CompletionCallback& callback, |
| 153 int rv); | 155 int rv); |
| 154 int HandleReadCompleted(IOBuffer* buf, int rv); | 156 int HandleReadCompleted(IOBuffer* buf, int rv); |
| 155 | 157 |
| 156 void WriteCompleted(IOBuffer* buf, | 158 // Binds with scoped_refptr<IOBuffer> instead of IOBuffer* to make sure buf |
| 159 // alive when this callback is called. | |
| 160 void WriteCompleted(scoped_refptr<IOBuffer> buf, | |
|
Ryan Sleevi
2014/07/11 18:13:35
scoped-refptrs should always be const-ref
byungchul
2014/07/11 18:58:18
Done.
| |
| 157 const CompletionCallback& callback, | 161 const CompletionCallback& callback, |
| 158 int rv) const; | 162 int rv) const; |
| 159 int HandleWriteCompleted(IOBuffer* buf, int rv) const; | 163 int HandleWriteCompleted(IOBuffer* buf, int rv) const; |
| 160 int TcpFastOpenWrite(IOBuffer* buf, | 164 int TcpFastOpenWrite(IOBuffer* buf, |
| 161 int buf_len, | 165 int buf_len, |
| 162 const CompletionCallback& callback); | 166 const CompletionCallback& callback); |
| 163 | 167 |
| 164 // Called when the socket is known to be in a connected state. | 168 // Called when the socket is known to be in a connected state. |
| 165 void RecordFastOpenStatus(); | 169 void RecordFastOpenStatus(); |
| 166 | 170 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 178 bool logging_multiple_connect_attempts_; | 182 bool logging_multiple_connect_attempts_; |
| 179 | 183 |
| 180 BoundNetLog net_log_; | 184 BoundNetLog net_log_; |
| 181 | 185 |
| 182 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); | 186 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); |
| 183 }; | 187 }; |
| 184 | 188 |
| 185 } // namespace net | 189 } // namespace net |
| 186 | 190 |
| 187 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ | 191 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
| OLD | NEW |