diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-17 00:52:35 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-17 00:52:35 +0000 |
commit | dabe607133c5b62e6b0134017f35cb87d0d4f3b6 (patch) | |
tree | db5d35947dcfa2810c7e7e19364ecaae37aa0912 /chrome/browser/plugin_process_host.cc | |
parent | a91baaa1bab5fe3de395aad464015a098290a46b (diff) | |
download | chromium_src-dabe607133c5b62e6b0134017f35cb87d0d4f3b6.zip chromium_src-dabe607133c5b62e6b0134017f35cb87d0d4f3b6.tar.gz chromium_src-dabe607133c5b62e6b0134017f35cb87d0d4f3b6.tar.bz2 |
Hide the details about ResourceDispatcherHost messages from child processes. The usage of RDH is now like RD, the client sends the message to RDH to see if it should handle it. I added methods to the Receiver interface so that RDH can get to the process id/handle/type when starting requests.
Review URL: http://codereview.chromium.org/42202
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11816 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_process_host.cc')
-rw-r--r-- | chrome/browser/plugin_process_host.cc | 64 |
1 files changed, 10 insertions, 54 deletions
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index f6a992e7..1e8d87b 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -364,8 +364,10 @@ void PluginProcessHost::AddWindow(HWND window) { #endif // defined(OS_WIN) -PluginProcessHost::PluginProcessHost(MessageLoop* main_message_loop) - : ChildProcessHost(PLUGIN_PROCESS, main_message_loop), +PluginProcessHost::PluginProcessHost() + : ChildProcessHost( + PLUGIN_PROCESS, + PluginService::GetInstance()->resource_dispatcher_host()), ALLOW_THIS_IN_INITIALIZER_LIST(resolve_proxy_msg_helper_(this, NULL)) { } @@ -551,11 +553,6 @@ void PluginProcessHost::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ShutdownRequest, OnPluginShutdownRequest) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginMessage, OnPluginMessage) - IPC_MESSAGE_HANDLER(ViewHostMsg_RequestResource, OnRequestResource) - IPC_MESSAGE_HANDLER(ViewHostMsg_CancelRequest, OnCancelRequest) - IPC_MESSAGE_HANDLER(ViewHostMsg_DataReceived_ACK, OnDataReceivedACK) - IPC_MESSAGE_HANDLER(ViewHostMsg_UploadProgress_ACK, OnUploadProgressACK) - IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_SyncLoad, OnSyncLoad) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetCookies, OnGetCookies) IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginProcessHostMsg_ResolveProxy, OnResolveProxy) @@ -606,53 +603,6 @@ void PluginProcessHost::OpenChannelToPlugin( RequestPluginChannel(renderer_message_filter, mime_type, reply_msg); } -void PluginProcessHost::OnRequestResource( - const IPC::Message& message, - int request_id, - const ViewHostMsg_Resource_Request& request) { - URLRequestContext* context = CPBrowsingContextManager::Instance()-> - ToURLRequestContext(request.request_context); - // TODO(mpcomplete): remove fallback case when Gears support is prevalent. - if (!context) - context = Profile::GetDefaultRequestContext(); - - PluginService::GetInstance()->resource_dispatcher_host()-> - BeginRequest(this, ChildProcessInfo::PLUGIN_PROCESS, handle(), - pid(), MSG_ROUTING_CONTROL, request_id, - request, context, NULL); -} - -void PluginProcessHost::OnCancelRequest(int request_id) { - PluginService::GetInstance()->resource_dispatcher_host()-> - CancelRequest(pid(), request_id, true); -} - -void PluginProcessHost::OnDataReceivedACK(int request_id) { - PluginService::GetInstance()->resource_dispatcher_host()-> - OnDataReceivedACK(pid(), request_id); -} - -void PluginProcessHost::OnUploadProgressACK(int request_id) { - PluginService::GetInstance()->resource_dispatcher_host()-> - OnUploadProgressACK(pid(), request_id); -} - -void PluginProcessHost::OnSyncLoad( - int request_id, - const ViewHostMsg_Resource_Request& request, - IPC::Message* sync_result) { - URLRequestContext* context = CPBrowsingContextManager::Instance()-> - ToURLRequestContext(request.request_context); - // TODO(mpcomplete): remove fallback case when Gears support is prevalent. - if (!context) - context = Profile::GetDefaultRequestContext(); - - PluginService::GetInstance()->resource_dispatcher_host()-> - BeginRequest(this, ChildProcessInfo::PLUGIN_PROCESS, handle(), - pid(), MSG_ROUTING_CONTROL, request_id, - request, context, sync_result); -} - void PluginProcessHost::OnGetCookies(uint32 request_context, const GURL& url, std::string* cookies) { @@ -694,6 +644,12 @@ void PluginProcessHost::ReplyToRenderer( renderer_message_filter->Send(reply_msg); } +URLRequestContext* PluginProcessHost::GetRequestContext( + uint32 request_id, + const ViewHostMsg_Resource_Request& request_data) { + return CPBrowsingContextManager::Instance()->ToURLRequestContext(request_id); +} + void PluginProcessHost::RequestPluginChannel( ResourceMessageFilter* renderer_message_filter, const std::string& mime_type, IPC::Message* reply_msg) { |