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

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

Issue 382143007: Make sure read/write buffer alive in TCPSocketLibevent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applied comments. Created 6 years, 5 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
« no previous file with comments | « no previous file | net/socket/tcp_socket_libevent.cc » ('j') | net/socket/tcp_socket_libevent.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(const 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.
Ryan Sleevi 2014/07/11 19:04:43 I don't think either of these comments are needed/
byungchul 2014/07/11 21:35:52 Moved to .cc
160 void WriteCompleted(const scoped_refptr<IOBuffer>& buf,
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
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_
OLDNEW
« no previous file with comments | « no previous file | net/socket/tcp_socket_libevent.cc » ('j') | net/socket/tcp_socket_libevent.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698