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

Unified Diff: net/base/socket.h

Issue 87073: Extend the use of IOBuffers to the code underneath... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 | « net/base/client_socket_pool_unittest.cc ('k') | net/base/ssl_client_socket_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/socket.h
===================================================================
--- net/base/socket.h (revision 14682)
+++ net/base/socket.h (working copy)
@@ -6,6 +6,7 @@
#define NET_BASE_SOCKET_H_
#include "net/base/completion_callback.h"
+#include "net/base/io_buffer.h"
namespace net {
@@ -18,16 +19,22 @@
// read is returned, or an error is returned upon failure. Zero is returned
// to indicate end-of-file. ERR_IO_PENDING is returned if the operation
// could not be completed synchronously, in which case the result will be
- // passed to the callback when available.
- virtual int Read(char* buf, int buf_len,
+ // passed to the callback when available. If the operation is not completed
+ // immediately, the socket acquires a reference to the provided buffer until
+ // the callback is invoked or the socket is destroyed.
+ virtual int Read(IOBuffer* buf, int buf_len,
CompletionCallback* callback) = 0;
// Writes data, up to buf_len bytes, to the socket. Note: only part of the
// data may be written! The number of bytes written is returned, or an error
// is returned upon failure. ERR_IO_PENDING is returned if the operation
// could not be completed synchronously, in which case the result will be
- // passed to the callback when available.
- virtual int Write(const char* buf, int buf_len,
+ // passed to the callback when available. If the operation is not completed
+ // immediately, the socket acquires a reference to the provided buffer until
+ // the callback is invoked or the socket is destroyed.
+ // Implementations of this method should not modify the contents of the actual
+ // buffer that is written to the socket.
+ virtual int Write(IOBuffer* buf, int buf_len,
CompletionCallback* callback) = 0;
};
« no previous file with comments | « net/base/client_socket_pool_unittest.cc ('k') | net/base/ssl_client_socket_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698