diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-02 22:20:23 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-02 22:20:23 +0000 |
commit | 5a5d9b5321e401c647d03646147db48e7f6ba89a (patch) | |
tree | 3d00e4fdf53c76fea42f3fae8616de9f9d22c664 /ppapi/proxy | |
parent | 18011cb7cb6e6f5e39e8eca7a546e61c8f4af721 (diff) | |
download | chromium_src-5a5d9b5321e401c647d03646147db48e7f6ba89a.zip chromium_src-5a5d9b5321e401c647d03646147db48e7f6ba89a.tar.gz chromium_src-5a5d9b5321e401c647d03646147db48e7f6ba89a.tar.bz2 |
Fix IPC-based NaCl PPAPI proxy to send upload / download progress messages.
Some NaCl apps require this, and it's not really part of the trusted interface.
BUG=116317
TEST=Mini Ninjas, From Dust work.
Review URL: https://codereview.chromium.org/11045002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 2 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_param_traits.cc | 68 | ||||
-rw-r--r-- | ppapi/proxy/ppb_url_loader_proxy.cc | 2 |
3 files changed, 34 insertions, 38 deletions
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index ba99e8c..92e7ee5 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -678,12 +678,10 @@ IPC_MESSAGE_ROUTED4(PpapiMsg_PPBUDPSocket_SendToACK, bool /* succeeded */, int32_t /* bytes_written */) -#if !defined(OS_NACL) && !defined(NACL_WIN64) // PPB_URLLoader_Trusted IPC_MESSAGE_ROUTED1( PpapiMsg_PPBURLLoader_UpdateProgress, ppapi::proxy::PPBURLLoader_UpdateProgress_Params /* params */) -#endif // !defined(OS_NACL) && !defined(NACL_WIN64) // PPB_TCPServerSocket_Private. diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc index 1c1ddbe..e5b820c 100644 --- a/ppapi/proxy/ppapi_param_traits.cc +++ b/ppapi/proxy/ppapi_param_traits.cc @@ -399,6 +399,40 @@ void ParamTraits<ppapi::proxy::SerializedHandle>::Log(const param_type& p, std::string* l) { } +// PPBURLLoader_UpdateProgress_Params ------------------------------------------ + +// static +void ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params>::Write( + Message* m, + const param_type& p) { + ParamTraits<PP_Instance>::Write(m, p.instance); + ParamTraits<ppapi::HostResource>::Write(m, p.resource); + ParamTraits<int64_t>::Write(m, p.bytes_sent); + ParamTraits<int64_t>::Write(m, p.total_bytes_to_be_sent); + ParamTraits<int64_t>::Write(m, p.bytes_received); + ParamTraits<int64_t>::Write(m, p.total_bytes_to_be_received); +} + +// static +bool ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params>::Read( + const Message* m, + PickleIterator* iter, + param_type* r) { + return + ParamTraits<PP_Instance>::Read(m, iter, &r->instance) && + ParamTraits<ppapi::HostResource>::Read(m, iter, &r->resource) && + ParamTraits<int64_t>::Read(m, iter, &r->bytes_sent) && + ParamTraits<int64_t>::Read(m, iter, &r->total_bytes_to_be_sent) && + ParamTraits<int64_t>::Read(m, iter, &r->bytes_received) && + ParamTraits<int64_t>::Read(m, iter, &r->total_bytes_to_be_received); +} + +// static +void ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params>::Log( + const param_type& p, + std::string* l) { +} + #if !defined(OS_NACL) && !defined(NACL_WIN64) // PPBFlash_DrawGlyphs_Params -------------------------------------------------- // static @@ -459,40 +493,6 @@ void ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params>::Log( std::string* l) { } -// PPBURLLoader_UpdateProgress_Params ------------------------------------------ - -// static -void ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params>::Write( - Message* m, - const param_type& p) { - ParamTraits<PP_Instance>::Write(m, p.instance); - ParamTraits<ppapi::HostResource>::Write(m, p.resource); - ParamTraits<int64_t>::Write(m, p.bytes_sent); - ParamTraits<int64_t>::Write(m, p.total_bytes_to_be_sent); - ParamTraits<int64_t>::Write(m, p.bytes_received); - ParamTraits<int64_t>::Write(m, p.total_bytes_to_be_received); -} - -// static -bool ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params>::Read( - const Message* m, - PickleIterator* iter, - param_type* r) { - return - ParamTraits<PP_Instance>::Read(m, iter, &r->instance) && - ParamTraits<ppapi::HostResource>::Read(m, iter, &r->resource) && - ParamTraits<int64_t>::Read(m, iter, &r->bytes_sent) && - ParamTraits<int64_t>::Read(m, iter, &r->total_bytes_to_be_sent) && - ParamTraits<int64_t>::Read(m, iter, &r->bytes_received) && - ParamTraits<int64_t>::Read(m, iter, &r->total_bytes_to_be_received); -} - -// static -void ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params>::Log( - const param_type& p, - std::string* l) { -} - // SerializedDirEntry ---------------------------------------------------------- // static diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc index 94d8baf..0521721 100644 --- a/ppapi/proxy/ppb_url_loader_proxy.cc +++ b/ppapi/proxy/ppb_url_loader_proxy.cc @@ -424,10 +424,8 @@ bool PPB_URLLoader_Proxy::OnMessageReceived(const IPC::Message& msg) { OnMsgClose) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLLoader_GrantUniversalAccess, OnMsgGrantUniversalAccess) -#if !defined(OS_NACL) IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_UpdateProgress, OnMsgUpdateProgress) -#endif IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack, OnMsgReadResponseBodyAck) IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_CallbackComplete, |