summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
diff options
context:
space:
mode:
authorneb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-28 22:15:13 +0000
committerneb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-28 22:15:13 +0000
commit748ce719f7594754695dfbd17b35618a58a5ffd1 (patch)
treecb8c9a30d8d8d64c4cfcbd3429535c3e6ec116c1 /ppapi/proxy
parentafbdbf11a0beb96ac10459e5748db0f5abc41ef5 (diff)
downloadchromium_src-748ce719f7594754695dfbd17b35618a58a5ffd1.zip
chromium_src-748ce719f7594754695dfbd17b35618a58a5ffd1.tar.gz
chromium_src-748ce719f7594754695dfbd17b35618a58a5ffd1.tar.bz2
Fix up some types in the API.
size_t -> int32_t, char* -> void* for buffers, void* -> const void* where needed. We already use int32_t when we serialize size_t (and unlike pointers, size_ts do get serialized a lot). char* for representing unstructured blocks of memory is weird, see "man 2 read" and friends. I'm removing it because it complicates our type system in IDL for no reason. const void* should be obvious. BUG=76271 TEST=none Review URL: http://codereview.chromium.org/6711047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r--ppapi/proxy/ppb_core_proxy.cc2
-rw-r--r--ppapi/proxy/ppb_url_loader_proxy.cc4
-rw-r--r--ppapi/proxy/ppb_url_request_info_proxy.cc4
3 files changed, 5 insertions, 5 deletions
diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc
index 34993fa..23c3d0b 100644
--- a/ppapi/proxy/ppb_core_proxy.cc
+++ b/ppapi/proxy/ppb_core_proxy.cc
@@ -36,7 +36,7 @@ void ReleaseResource(PP_Resource resource) {
PluginResourceTracker::GetInstance()->ReleaseResource(resource);
}
-void* MemAlloc(size_t num_bytes) {
+void* MemAlloc(uint32_t num_bytes) {
return malloc(num_bytes);
}
diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc
index 74b79d9..7f06b46 100644
--- a/ppapi/proxy/ppb_url_loader_proxy.cc
+++ b/ppapi/proxy/ppb_url_loader_proxy.cc
@@ -47,7 +47,7 @@ class URLLoader : public PluginResource {
// When an asynchronous read is pending, this will contain the callback and
// the buffer to put the data.
PP_CompletionCallback current_read_callback_;
- char* current_read_buffer_;
+ void* current_read_buffer_;
// Cached copy of the response info. When nonzero, we're holding a reference
// to this resource.
@@ -205,7 +205,7 @@ PP_Resource GetResponseInfo(PP_Resource loader_id) {
}
int32_t ReadResponseBody(PP_Resource loader_id,
- char* buffer,
+ void* buffer,
int32_t bytes_to_read,
PP_CompletionCallback callback) {
URLLoader* loader_object;
diff --git a/ppapi/proxy/ppb_url_request_info_proxy.cc b/ppapi/proxy/ppb_url_request_info_proxy.cc
index 385f13a..1492a37 100644
--- a/ppapi/proxy/ppb_url_request_info_proxy.cc
+++ b/ppapi/proxy/ppb_url_request_info_proxy.cc
@@ -79,7 +79,7 @@ PP_Bool SetProperty(PP_Resource request_id,
}
PP_Bool AppendDataToBody(PP_Resource request_id,
- const char* data, uint32_t len) {
+ const void* data, uint32_t len) {
PluginDispatcher* dispatcher;
URLRequestInfo* request_info;
if (!DispatcherFromURLRequestInfo(request_id, &dispatcher, &request_info))
@@ -87,7 +87,7 @@ PP_Bool AppendDataToBody(PP_Resource request_id,
dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody(
INTERFACE_ID_PPB_URL_REQUEST_INFO, request_info->host_resource(),
- std::string(data, len)));
+ std::string(static_cast<const char*>(data), len)));
// TODO(brettw) do some validation. We should be able to tell on the plugin
// side whether the request will succeed or fail in the renderer.