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

Unified Diff: ppapi/api/ppb_url_loader.idl

Issue 11417145: Provide a safer URLLoader ReadResponseBody API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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 | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | ppapi/c/ppb_url_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/ppb_url_loader.idl
diff --git a/ppapi/api/ppb_url_loader.idl b/ppapi/api/ppb_url_loader.idl
index ad311009e67c7e1caed6e6ce58c9a152e42e00ff..03463a6e2f058ef61c5329cc7ba9100befdb78f8 100644
--- a/ppapi/api/ppb_url_loader.idl
+++ b/ppapi/api/ppb_url_loader.idl
@@ -9,7 +9,8 @@
*/
label Chrome {
- M14 = 1.0
+ M14 = 1.0,
+ M26 = 1.1
};
/**
@@ -163,6 +164,9 @@ interface PPB_URLLoader {
* buffer must be large enough to hold the specified number of bytes to read.
* This function might perform a partial read.
*
+ * ReadResponseBodyToArray() is preferred to ReadResponseBody() when doing
+ * asynchronous operations.
+ *
* @param[in] loader A <code>PP_Resource</code> corresponding to a
* <code>URLLoader</code>.
* @param[in,out] buffer A pointer to the buffer for the response body.
@@ -217,5 +221,29 @@ interface PPB_URLLoader {
*/
void Close(
[in] PP_Resource loader);
+
+ /**
+ * ReadResponseBody() is used to read the response body. The size of the
+ * buffer must be large enough to hold the specified number of bytes to read.
+ * This function might perform a partial read.
+ *
+ * @param[in] loader A <code>PP_Resource</code> corresponding to a
+ * <code>URLLoader</code>.
+ * @param[in,out] output A <code>PP_ArrayOutput</code> to hold the output.
+ * @param[in] max_read_length The number of bytes to read.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to run on
+ * asynchronous completion. The callback will run if the bytes (full or
+ * partial) are read or an error occurs asynchronously. This callback will
+ * run only if this function returns <code>PP_OK_COMPLETIONPENDING</code>.
+ *
+ * @return An int32_t containing the number of bytes read or an error code
+ * from <code>pp_errors.h</code>.
+ */
+ [version = 1.1]
+ int32_t ReadResponseBodyToArray(
+ [in] PP_Resource loader,
+ [in] int32_t max_read_length,
+ [inout] PP_ArrayOutput output,
+ [in] PP_CompletionCallback callback);
};
« no previous file with comments | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | ppapi/c/ppb_url_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698