summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
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 /webkit/plugins
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 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc2
-rw-r--r--webkit/plugins/ppapi/ppb_context_3d_impl.cc2
-rw-r--r--webkit/plugins/ppapi/ppb_url_loader_impl.cc6
-rw-r--r--webkit/plugins/ppapi/ppb_url_loader_impl.h2
-rw-r--r--webkit/plugins/ppapi/ppb_url_request_info_impl.cc5
5 files changed, 9 insertions, 8 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index ff6b085..b4ab5f0 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -137,7 +137,7 @@ void ReleaseResource(PP_Resource resource) {
}
}
-void* MemAlloc(size_t num_bytes) {
+void* MemAlloc(uint32_t num_bytes) {
return malloc(num_bytes);
}
diff --git a/webkit/plugins/ppapi/ppb_context_3d_impl.cc b/webkit/plugins/ppapi/ppb_context_3d_impl.cc
index eb058a5..9494459 100644
--- a/webkit/plugins/ppapi/ppb_context_3d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_context_3d_impl.cc
@@ -194,7 +194,7 @@ PP_Context3DTrustedState FlushSync(PP_Resource context_id, int32_t put_offset) {
return PPStateFromGPUState(context->command_buffer()->FlushSync(put_offset));
}
-int32_t CreateTransferBuffer(PP_Resource context_id, size_t size) {
+int32_t CreateTransferBuffer(PP_Resource context_id, uint32_t size) {
scoped_refptr<PPB_Context3D_Impl> context(
Resource::GetAs<PPB_Context3D_Impl>(context_id));
if (!context.get() || !context->command_buffer())
diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.cc b/webkit/plugins/ppapi/ppb_url_loader_impl.cc
index ccccd25..e73ec96 100644
--- a/webkit/plugins/ppapi/ppb_url_loader_impl.cc
+++ b/webkit/plugins/ppapi/ppb_url_loader_impl.cc
@@ -122,7 +122,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) {
scoped_refptr<PPB_URLLoader_Impl> loader(
@@ -311,7 +311,7 @@ bool PPB_URLLoader_Impl::GetDownloadProgress(
return true;
}
-int32_t PPB_URLLoader_Impl::ReadResponseBody(char* buffer,
+int32_t PPB_URLLoader_Impl::ReadResponseBody(void* buffer,
int32_t bytes_to_read,
PP_CompletionCallback callback) {
int32_t rv = ValidateCallback(callback);
@@ -322,7 +322,7 @@ int32_t PPB_URLLoader_Impl::ReadResponseBody(char* buffer,
if (bytes_to_read <= 0 || !buffer)
return PP_ERROR_BADARGUMENT;
- user_buffer_ = buffer;
+ user_buffer_ = static_cast<char*>(buffer);
user_buffer_size_ = bytes_to_read;
if (!buffer_.empty())
diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.h b/webkit/plugins/ppapi/ppb_url_loader_impl.h
index 12fb3ba..48b416d 100644
--- a/webkit/plugins/ppapi/ppb_url_loader_impl.h
+++ b/webkit/plugins/ppapi/ppb_url_loader_impl.h
@@ -56,7 +56,7 @@ class PPB_URLLoader_Impl : public Resource, public WebKit::WebURLLoaderClient {
int64_t* total_bytes_to_be_sent);
bool GetDownloadProgress(int64_t* bytes_received,
int64_t* total_bytes_to_be_received);
- int32_t ReadResponseBody(char* buffer, int32_t bytes_to_read,
+ int32_t ReadResponseBody(void* buffer, int32_t bytes_to_read,
PP_CompletionCallback callback);
int32_t FinishStreamingToFile(PP_CompletionCallback callback);
void Close();
diff --git a/webkit/plugins/ppapi/ppb_url_request_info_impl.cc b/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
index d2c5ef7..a3685d3 100644
--- a/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
+++ b/webkit/plugins/ppapi/ppb_url_request_info_impl.cc
@@ -127,14 +127,15 @@ PP_Bool SetProperty(PP_Resource request_id,
}
PP_Bool AppendDataToBody(PP_Resource request_id,
- const char* data,
+ const void* data,
uint32_t len) {
scoped_refptr<PPB_URLRequestInfo_Impl> request(
Resource::GetAs<PPB_URLRequestInfo_Impl>(request_id));
if (!request)
return PP_FALSE;
- return BoolToPPBool(request->AppendDataToBody(std::string(data, len)));
+ return BoolToPPBool(request->AppendDataToBody(std::string(
+ static_cast<const char*>(data), len)));
}
PP_Bool AppendFileToBody(PP_Resource request_id,