summaryrefslogtreecommitdiffstats
path: root/content/browser/loader/resource_dispatcher_host_impl.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-13 23:19:10 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-13 23:19:10 +0000
commit5636d90f630655abf66427e30d15f615dc939797 (patch)
tree434691134b27d5f98aaff57635b05bcdba98e1b7 /content/browser/loader/resource_dispatcher_host_impl.cc
parent07243f95c726fb67abefa8a19fb9c46e2d63d8f8 (diff)
downloadchromium_src-5636d90f630655abf66427e30d15f615dc939797.zip
chromium_src-5636d90f630655abf66427e30d15f615dc939797.tar.gz
chromium_src-5636d90f630655abf66427e30d15f615dc939797.tar.bz2
Add support for passing an arbitrary parameter to an IPC message handler. The motivation is for WebContentsObserver to pass RenderFrameHost* to message handlers easily.
As an example, an observer would look like this: bool FooWebContentsObserver::OnMessageReceived( const IPC::Message& message, RenderFrameHost* render_frame_host) { IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(FooWebContentsObserver, message, RenderFrameHost, render_frame_host) IPC_MESSAGE_HANDLER(FooHostMsg_Bar, OnBar) . . . void FooWebContentsObserver::OnBar(RenderFrameHost* render_frame_host, ... You can of course still have dispatchers without the extra parameter as before. This is generalizing the existing code that allows an IPC message handler to have a "const IPC::Message& message) first parameter to get access to the IPC. Sync IPCs don't support this yet. It's a lot more work because for them we conveniently reuse tuple's DispatchToMethod. This isn't urgent yet, since sync IPCs aren't dispatched on the UI thread for the most part because of NPAPI and Windows, so punting on this for now. BUG=304341 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/283623002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/loader/resource_dispatcher_host_impl.cc')
-rw-r--r--content/browser/loader/resource_dispatcher_host_impl.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 7448116..917d0e1 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -859,10 +859,10 @@ bool ResourceDispatcherHostImpl::OnMessageReceived(
}
void ResourceDispatcherHostImpl::OnRequestResource(
- const IPC::Message& message,
+ int routing_id,
int request_id,
const ResourceHostMsg_Request& request_data) {
- BeginRequest(request_id, request_data, NULL, message.routing_id());
+ BeginRequest(request_id, request_data, NULL, routing_id);
}
// Begins a resource request with the given params on behalf of the specified