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

Unified Diff: base/platform_file.h

Issue 7821013: Base: Change ReadPlatformFile to perform a best (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | base/platform_file_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file.h
===================================================================
--- base/platform_file.h (revision 99047)
+++ base/platform_file.h (working copy)
@@ -117,10 +117,19 @@
BASE_EXPORT bool ClosePlatformFile(PlatformFile file);
// Reads the given number of bytes (or until EOF is reached) starting with the
-// given offset. Returns the number of bytes read, or -1 on error.
+// given offset. Returns the number of bytes read, or -1 on error. Note that
+// this function makes a best effort to read all data on all platforms, so it is
+// not intended for stream oriented files but instead for cases when the normal
+// expectation is that actually |size| bytes are read unless there is an error.
BASE_EXPORT int ReadPlatformFile(PlatformFile file, int64 offset,
char* data, int size);
+// Reads the given number of bytes (or until EOF is reached) starting with the
+// given offset, but does not make any effort to read all data on all platforms.
+// Returns the number of bytes read, or -1 on error.
+BASE_EXPORT int ReadPlatformFileNoBestEffort(PlatformFile file, int64 offset,
+ char* data, int size);
+
// Writes the given buffer into the file at the given offset, overwritting any
// data that was previously there. Returns the number of bytes written, or -1
// on error. Note that this function makes a best effort to write all data on
« no previous file with comments | « no previous file | base/platform_file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698