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

Unified Diff: ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c

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 | « ppapi/cpp/url_loader.cc ('k') | ppapi/proxy/ppb_url_loader_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index 4bfd360f4893143afb0391a7ba989ea8984080ce..9ddcaa62c3bb0eebacbd041a742546d747fac247 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -141,6 +141,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Messaging_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_MouseCursor_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_MouseLock_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLLoader_1_0;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLLoader_1_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLRequestInfo_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLResponseInfo_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Var_1_0;
@@ -970,6 +971,76 @@ void Pnacl_M14_PPB_URLLoader_Close(PP_Resource loader) {
/* End wrapper methods for PPB_URLLoader_1_0 */
+/* Begin wrapper methods for PPB_URLLoader_1_1 */
+
+static __attribute__((pnaclcall))
+PP_Resource Pnacl_M26_PPB_URLLoader_Create(PP_Instance instance) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->Create(instance);
+}
+
+static __attribute__((pnaclcall))
+PP_Bool Pnacl_M26_PPB_URLLoader_IsURLLoader(PP_Resource resource) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->IsURLLoader(resource);
+}
+
+static __attribute__((pnaclcall))
+int32_t Pnacl_M26_PPB_URLLoader_Open(PP_Resource loader, PP_Resource request_info, struct PP_CompletionCallback callback) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->Open(loader, request_info, callback);
+}
+
+static __attribute__((pnaclcall))
+int32_t Pnacl_M26_PPB_URLLoader_FollowRedirect(PP_Resource loader, struct PP_CompletionCallback callback) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->FollowRedirect(loader, callback);
+}
+
+static __attribute__((pnaclcall))
+PP_Bool Pnacl_M26_PPB_URLLoader_GetUploadProgress(PP_Resource loader, int64_t* bytes_sent, int64_t* total_bytes_to_be_sent) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->GetUploadProgress(loader, bytes_sent, total_bytes_to_be_sent);
+}
+
+static __attribute__((pnaclcall))
+PP_Bool Pnacl_M26_PPB_URLLoader_GetDownloadProgress(PP_Resource loader, int64_t* bytes_received, int64_t* total_bytes_to_be_received) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->GetDownloadProgress(loader, bytes_received, total_bytes_to_be_received);
+}
+
+static __attribute__((pnaclcall))
+PP_Resource Pnacl_M26_PPB_URLLoader_GetResponseInfo(PP_Resource loader) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->GetResponseInfo(loader);
+}
+
+static __attribute__((pnaclcall))
+int32_t Pnacl_M26_PPB_URLLoader_ReadResponseBody(PP_Resource loader, void* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->ReadResponseBody(loader, buffer, bytes_to_read, callback);
+}
+
+static __attribute__((pnaclcall))
+int32_t Pnacl_M26_PPB_URLLoader_FinishStreamingToFile(PP_Resource loader, struct PP_CompletionCallback callback) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->FinishStreamingToFile(loader, callback);
+}
+
+static __attribute__((pnaclcall))
+void Pnacl_M26_PPB_URLLoader_Close(PP_Resource loader) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ iface->Close(loader);
+}
+
+static __attribute__((pnaclcall))
+int32_t Pnacl_M26_PPB_URLLoader_ReadResponseBodyToArray(PP_Resource loader, int32_t max_read_length, struct PP_ArrayOutput* output, struct PP_CompletionCallback callback) {
+ const struct PPB_URLLoader_1_1 *iface = Pnacl_WrapperInfo_PPB_URLLoader_1_1.real_iface;
+ return iface->ReadResponseBodyToArray(loader, max_read_length, output, callback);
+}
+
+/* End wrapper methods for PPB_URLLoader_1_1 */
+
/* Begin wrapper methods for PPB_URLRequestInfo_1_0 */
static __attribute__((pnaclcall))
@@ -3685,6 +3756,20 @@ struct PPB_URLLoader_1_0 Pnacl_Wrappers_PPB_URLLoader_1_0 = {
.Close = (void (*)(PP_Resource loader))&Pnacl_M14_PPB_URLLoader_Close
};
+struct PPB_URLLoader_1_1 Pnacl_Wrappers_PPB_URLLoader_1_1 = {
+ .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M26_PPB_URLLoader_Create,
+ .IsURLLoader = (PP_Bool (*)(PP_Resource resource))&Pnacl_M26_PPB_URLLoader_IsURLLoader,
+ .Open = (int32_t (*)(PP_Resource loader, PP_Resource request_info, struct PP_CompletionCallback callback))&Pnacl_M26_PPB_URLLoader_Open,
+ .FollowRedirect = (int32_t (*)(PP_Resource loader, struct PP_CompletionCallback callback))&Pnacl_M26_PPB_URLLoader_FollowRedirect,
+ .GetUploadProgress = (PP_Bool (*)(PP_Resource loader, int64_t* bytes_sent, int64_t* total_bytes_to_be_sent))&Pnacl_M26_PPB_URLLoader_GetUploadProgress,
+ .GetDownloadProgress = (PP_Bool (*)(PP_Resource loader, int64_t* bytes_received, int64_t* total_bytes_to_be_received))&Pnacl_M26_PPB_URLLoader_GetDownloadProgress,
+ .GetResponseInfo = (PP_Resource (*)(PP_Resource loader))&Pnacl_M26_PPB_URLLoader_GetResponseInfo,
+ .ReadResponseBody = (int32_t (*)(PP_Resource loader, void* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback))&Pnacl_M26_PPB_URLLoader_ReadResponseBody,
+ .FinishStreamingToFile = (int32_t (*)(PP_Resource loader, struct PP_CompletionCallback callback))&Pnacl_M26_PPB_URLLoader_FinishStreamingToFile,
+ .Close = (void (*)(PP_Resource loader))&Pnacl_M26_PPB_URLLoader_Close,
+ .ReadResponseBodyToArray = (int32_t (*)(PP_Resource loader, int32_t max_read_length, struct PP_ArrayOutput* output, struct PP_CompletionCallback callback))&Pnacl_M26_PPB_URLLoader_ReadResponseBodyToArray
+};
+
struct PPB_URLRequestInfo_1_0 Pnacl_Wrappers_PPB_URLRequestInfo_1_0 = {
.Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M14_PPB_URLRequestInfo_Create,
.IsURLRequestInfo = (PP_Bool (*)(PP_Resource resource))&Pnacl_M14_PPB_URLRequestInfo_IsURLRequestInfo,
@@ -4478,6 +4563,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLLoader_1_0 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLLoader_1_1 = {
+ .iface_macro = PPB_URLLOADER_INTERFACE_1_1,
+ .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_URLLoader_1_1,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLRequestInfo_1_0 = {
.iface_macro = PPB_URLREQUESTINFO_INTERFACE_1_0,
.wrapped_iface = (void *) &Pnacl_Wrappers_PPB_URLRequestInfo_1_0,
@@ -5135,6 +5226,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_MouseCursor_1_0,
&Pnacl_WrapperInfo_PPB_MouseLock_1_0,
&Pnacl_WrapperInfo_PPB_URLLoader_1_0,
+ &Pnacl_WrapperInfo_PPB_URLLoader_1_1,
&Pnacl_WrapperInfo_PPB_URLRequestInfo_1_0,
&Pnacl_WrapperInfo_PPB_URLResponseInfo_1_0,
&Pnacl_WrapperInfo_PPB_Var_1_0,
« no previous file with comments | « ppapi/cpp/url_loader.cc ('k') | ppapi/proxy/ppb_url_loader_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698