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

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: 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..add22dd3bcf2032e246fc1fdeb4f05e98386cc84 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(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.
+ 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.
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