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

Unified Diff: ppapi/c/ppb_file_io.h

Issue 27730003: Avoid memory allocation for PPB_FileIO Read when callback is blocking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address David's second round of comments. Created 7 years, 2 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 | « ppapi/c/pp_array_output.h ('k') | ppapi/cpp/file_io.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/ppb_file_io.h
diff --git a/ppapi/c/ppb_file_io.h b/ppapi/c/ppb_file_io.h
index fe0e1bd4bba47ad62c899bb84994b188ac03b9de..8f272bf5a0dd678e4b886962404367aa15f604a5 100644
--- a/ppapi/c/ppb_file_io.h
+++ b/ppapi/c/ppb_file_io.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_file_io.idl modified Tue Jun 11 15:21:38 2013. */
+/* From ppb_file_io.idl modified Tue Oct 22 15:09:47 2013. */
#ifndef PPAPI_C_PPB_FILE_IO_H_
#define PPAPI_C_PPB_FILE_IO_H_
@@ -135,7 +135,9 @@ struct PPB_FileIO_1_1 {
* @param[out] info The <code>PP_FileInfo</code> structure representing all
* information about the file.
* @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
- * completion of Query().
+ * completion of Query(). <code>info</code> must remain valid until after the
+ * callback runs. If you pass a blocking callback, <code>info</code> must
+ * remain valid until after Query() returns.
*
* @return An int32_t containing an error code from <code>pp_errors.h</code>.
* PP_ERROR_FAILED will be returned if the file isn't opened, and
@@ -170,6 +172,7 @@ struct PPB_FileIO_1_1 {
* large enough to hold the specified number of bytes to read. This function
* might perform a partial read, meaning all the requested bytes
* might not be returned, even if the end of the file has not been reached.
+ * The FileIO object must have been opened with read access.
*
* ReadToArray() is preferred to Read() when doing asynchronous operations.
*
@@ -180,7 +183,9 @@ struct PPB_FileIO_1_1 {
* @param[in] bytes_to_read The number of bytes to read from
* <code>offset</code>.
* @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
- * completion of Read().
+ * completion of Read(). <code>buffer</code> must remain valid until after
+ * the callback runs. If you pass a blocking callback, <code>buffer</code>
+ * must remain valid until after Read() returns.
*
* @return The number of bytes read or an error code from
* <code>pp_errors.h</code>. If the return value is 0, then end-of-file was
@@ -267,7 +272,8 @@ struct PPB_FileIO_1_1 {
/**
* ReadToArray() reads from an offset in the file. A PP_ArrayOutput must be
* provided so that output will be stored in its allocated buffer. This
- * function might perform a partial read.
+ * function might perform a partial read. The FileIO object must have been
+ * opened with read access.
*
* @param[in] file_io A <code>PP_Resource</code> corresponding to a file
* FileIO.
« no previous file with comments | « ppapi/c/pp_array_output.h ('k') | ppapi/cpp/file_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698