diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-13 23:19:10 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-13 23:19:10 +0000 |
commit | 5636d90f630655abf66427e30d15f615dc939797 (patch) | |
tree | 434691134b27d5f98aaff57635b05bcdba98e1b7 /content/browser/loader/resource_dispatcher_host_impl.h | |
parent | 07243f95c726fb67abefa8a19fb9c46e2d63d8f8 (diff) | |
download | chromium_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.h')
-rw-r--r-- | content/browser/loader/resource_dispatcher_host_impl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/content/browser/loader/resource_dispatcher_host_impl.h b/content/browser/loader/resource_dispatcher_host_impl.h index 449bc13..8f839c8 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.h +++ b/content/browser/loader/resource_dispatcher_host_impl.h @@ -340,7 +340,7 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl int route_id, bool cancel_requests); - void OnRequestResource(const IPC::Message& msg, + void OnRequestResource(int routing_id, int request_id, const ResourceHostMsg_Request& request_data); void OnSyncLoad(int request_id, |