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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/socket/tcp_socket_libevent.cc » ('j') | net/socket/tcp_socket_libevent.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_socket_libevent.h
diff --git a/net/socket/tcp_socket_libevent.h b/net/socket/tcp_socket_libevent.h
index 59978aa3bb3969b256bc73cd41166566121e3da9..ba34aeebcd4bbcde9b15ac7104b6b863861ed049 100644
--- a/net/socket/tcp_socket_libevent.h
+++ b/net/socket/tcp_socket_libevent.h
@@ -148,12 +148,16 @@ class NET_EXPORT TCPSocketLibevent {
void LogConnectBegin(const AddressList& addresses) const;
void LogConnectEnd(int net_error) const;
- void ReadCompleted(IOBuffer* buf,
+ // Binds with scoped_refptr<IOBuffer> instead of IOBuffer* to make sure buf
+ // alive when this callback is called.
+ void ReadCompleted(const scoped_refptr<IOBuffer>& buf,
const CompletionCallback& callback,
int rv);
int HandleReadCompleted(IOBuffer* buf, int rv);
- void WriteCompleted(IOBuffer* buf,
+ // Binds with scoped_refptr<IOBuffer> instead of IOBuffer* to make sure buf
+ // 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
+ void WriteCompleted(const scoped_refptr<IOBuffer>& buf,
const CompletionCallback& callback,
int rv) const;
int HandleWriteCompleted(IOBuffer* buf, int rv) const;
« 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