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/cpp/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/ppb_file_io.h ('k') | ppapi/proxy/file_io_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/file_io.h
diff --git a/ppapi/cpp/file_io.h b/ppapi/cpp/file_io.h
index 99d8ce74d90c04f7ee6b88580909b990c3db54b3..bbd6b57b9ec288d700a319b2fc66b9ed7a571897 100644
--- a/ppapi/cpp/file_io.h
+++ b/ppapi/cpp/file_io.h
@@ -71,7 +71,9 @@ class FileIO : public Resource {
/// @param[in] result_buf The <code>PP_FileInfo</code> structure representing
/// all information about the file.
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
- /// completion of Query().
+ /// completion of Query(). <code>result_buf</code> must remain valid until
+ /// after the callback runs. If you pass a blocking callback,
+ /// <code>result_buf</code> must remain valid until after Query() returns.
///
/// @return An int32_t containing an error code from
/// <code>pp_errors.h</code>.
@@ -138,7 +140,9 @@ class FileIO : public Resource {
/// @param[in] bytes_to_read The number of bytes to read from
/// <code>offset</code>.
/// @param[in] cc A <code>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 An The number of bytes read an error code from
/// <code>pp_errors.h</code>. If the return value is 0, then end-of-file was
« no previous file with comments | « ppapi/c/ppb_file_io.h ('k') | ppapi/proxy/file_io_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698