diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-18 05:44:23 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-18 05:44:23 +0000 |
commit | 214832f40d2351a88579d65de1ac6830dc0ed356 (patch) | |
tree | 1a0b18bf4c18a5e22b31ce67a5d43746692b53b8 /ppapi/proxy/ppb_url_loader_proxy.h | |
parent | 4e7b125c9beb49512e4d895bc1ee462f34f2dd7d (diff) | |
download | chromium_src-214832f40d2351a88579d65de1ac6830dc0ed356.zip chromium_src-214832f40d2351a88579d65de1ac6830dc0ed356.tar.gz chromium_src-214832f40d2351a88579d65de1ac6830dc0ed356.tar.bz2 |
Eliminate some buffer copies in the URLLoader proxy.
Change ReadResponseBody_Ack to be a custom generated message so that the plugin
can read directly from the IPC::Message payload. Copy data directly from the
IPC::Message to current_read_buffer_, and only use buffer_ for when the
IPC::Message has more data than can fit in current_read_buffer_.
Change the sender of ReadResponseBody_Ack to write directly into the
IPC::Message that will be sent.
Modify URLLoader::ReadResponseBody to read from buffer_ even when the size
of buffer_ is relatively small.
R=brettw@chromium.org
Review URL: https://codereview.chromium.org/10915301
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157307 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_url_loader_proxy.h')
-rw-r--r-- | ppapi/proxy/ppb_url_loader_proxy.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ppapi/proxy/ppb_url_loader_proxy.h b/ppapi/proxy/ppb_url_loader_proxy.h index 801f25b..dd0bb34 100644 --- a/ppapi/proxy/ppb_url_loader_proxy.h +++ b/ppapi/proxy/ppb_url_loader_proxy.h @@ -54,9 +54,6 @@ class PPB_URLLoader_Proxy : public InterfaceProxy { static const ApiID kApiID = API_ID_PPB_URL_LOADER; private: - // Data associated with callbacks for ReadResponseBody. - struct ReadCallbackInfo; - // Plugin->renderer message handlers. void OnMsgCreate(PP_Instance instance, HostResource* result); @@ -74,14 +71,12 @@ class PPB_URLLoader_Proxy : public InterfaceProxy { // Renderer->plugin message handlers. void OnMsgUpdateProgress( const PPBURLLoader_UpdateProgress_Params& params); - void OnMsgReadResponseBodyAck(const HostResource& host_resource, - int32_t result, - const std::string& data); + void OnMsgReadResponseBodyAck(const IPC::Message& message); void OnMsgCallbackComplete(const HostResource& host_resource, int32_t result); - // Handles callbacks for read complete messages. Takes ownership of the info - // pointer. - void OnReadCallback(int32_t result, ReadCallbackInfo* info); + // Handles callbacks for read complete messages. Takes ownership of the + // message pointer. + void OnReadCallback(int32_t result, IPC::Message* message); // Handles callback for everything but reads. void OnCallback(int32_t result, const HostResource& resource); |