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

Unified Diff: ppapi/api/ppb_file_io.idl

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/api/pp_array_output.idl ('k') | ppapi/c/pp_array_output.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/ppb_file_io.idl
diff --git a/ppapi/api/ppb_file_io.idl b/ppapi/api/ppb_file_io.idl
index 2e43ec54c1c7ca7d7ffacbe3b6fbb17ac10a3008..9b8c9e22bdfd2c5b66fc335abe190c0fe2a721bf 100644
--- a/ppapi/api/ppb_file_io.idl
+++ b/ppapi/api/ppb_file_io.idl
@@ -121,7 +121,9 @@ interface PPB_FileIO {
* @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
@@ -158,6 +160,7 @@ interface PPB_FileIO {
* 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.
*
@@ -168,7 +171,9 @@ interface PPB_FileIO {
* @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
@@ -260,7 +265,8 @@ interface PPB_FileIO {
/**
* 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/api/pp_array_output.idl ('k') | ppapi/c/pp_array_output.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698