diff options
author | neb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 22:15:13 +0000 |
---|---|---|
committer | neb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 22:15:13 +0000 |
commit | 748ce719f7594754695dfbd17b35618a58a5ffd1 (patch) | |
tree | cb8c9a30d8d8d64c4cfcbd3429535c3e6ec116c1 /ppapi/cpp | |
parent | afbdbf11a0beb96ac10459e5748db0f5abc41ef5 (diff) | |
download | chromium_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/cpp')
-rw-r--r-- | ppapi/cpp/core.h | 2 | ||||
-rw-r--r-- | ppapi/cpp/url_loader.cc | 2 | ||||
-rw-r--r-- | ppapi/cpp/url_loader.h | 2 | ||||
-rw-r--r-- | ppapi/cpp/url_request_info.cc | 2 | ||||
-rw-r--r-- | ppapi/cpp/url_request_info.h | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/ppapi/cpp/core.h b/ppapi/cpp/core.h index 50c89d5..7f0fefc 100644 --- a/ppapi/cpp/core.h +++ b/ppapi/cpp/core.h @@ -27,7 +27,7 @@ class Core { interface_->ReleaseResource(resource); } - void* MemAlloc(size_t num_bytes) { + void* MemAlloc(uint32_t num_bytes) { return interface_->MemAlloc(num_bytes); } void MemFree(void* ptr) { diff --git a/ppapi/cpp/url_loader.cc b/ppapi/cpp/url_loader.cc index 81bcdfd..cf05f3c 100644 --- a/ppapi/cpp/url_loader.cc +++ b/ppapi/cpp/url_loader.cc @@ -88,7 +88,7 @@ URLResponseInfo URLLoader::GetResponseInfo() const { pp_resource())); } -int32_t URLLoader::ReadResponseBody(char* buffer, +int32_t URLLoader::ReadResponseBody(void* buffer, int32_t bytes_to_read, const CompletionCallback& cc) { if (!has_interface<PPB_URLLoader>()) diff --git a/ppapi/cpp/url_loader.h b/ppapi/cpp/url_loader.h index 387d1dc2..6db80f96 100644 --- a/ppapi/cpp/url_loader.h +++ b/ppapi/cpp/url_loader.h @@ -97,7 +97,7 @@ class URLLoader : public Resource { bool GetDownloadProgress(int64_t* bytes_received, int64_t* total_bytes_to_be_received) const; URLResponseInfo GetResponseInfo() const; - int32_t ReadResponseBody(char* buffer, + int32_t ReadResponseBody(void* buffer, int32_t bytes_to_read, const CompletionCallback& cc); int32_t FinishStreamingToFile(const CompletionCallback& cc); diff --git a/ppapi/cpp/url_request_info.cc b/ppapi/cpp/url_request_info.cc index 76cf832..1303d71 100644 --- a/ppapi/cpp/url_request_info.cc +++ b/ppapi/cpp/url_request_info.cc @@ -39,7 +39,7 @@ bool URLRequestInfo::SetProperty(PP_URLRequestProperty property, pp_resource(), property, value.pp_var())); } -bool URLRequestInfo::AppendDataToBody(const char* data, uint32_t len) { +bool URLRequestInfo::AppendDataToBody(const void* data, uint32_t len) { if (!has_interface<PPB_URLRequestInfo>()) return false; return PPBoolToBool(get_interface<PPB_URLRequestInfo>()->AppendDataToBody( diff --git a/ppapi/cpp/url_request_info.h b/ppapi/cpp/url_request_info.h index eabf91d..2530085 100644 --- a/ppapi/cpp/url_request_info.h +++ b/ppapi/cpp/url_request_info.h @@ -24,7 +24,7 @@ class URLRequestInfo : public Resource { // PPB_URLRequestInfo methods: bool SetProperty(PP_URLRequestProperty property, const Var& value); - bool AppendDataToBody(const char* data, uint32_t len); + bool AppendDataToBody(const void* data, uint32_t len); bool AppendFileToBody(const FileRef_Dev& file_ref, PP_Time expected_last_modified_time = 0); bool AppendFileRangeToBody(const FileRef_Dev& file_ref, |