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

Unified Diff: net/base/file_stream.h

Issue 21363: Adds a new method ReadUntilComplete to FileStream which ensure that a... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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/base/file_stream_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream.h
===================================================================
--- net/base/file_stream.h (revision 9711)
+++ net/base/file_stream.h (working copy)
@@ -81,6 +81,13 @@
// You can pass NULL as the callback for synchronous I/O.
int Read(char* buf, int buf_len, CompletionCallback* callback);
+ // Performs the same as Read, but ensures that exactly buf_len bytes
+ // are copied into buf. A partial read may occur, but only as a result of
+ // end-of-file or fatal error. Returns the number of bytes copied into buf,
+ // 0 if at end-of-file and no bytes have been read into buf yet,
+ // or an error code if the operation could not be performed.
+ int ReadUntilComplete(char *buf, int buf_len);
+
// Call this method to write data at the current stream position. Up to
// buf_len bytes will be written from buf. (In other words, partial writes are
// allowed.) Returns the number of bytes written, or an error code if the
« no previous file with comments | « no previous file | net/base/file_stream_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698