Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: ipc/ipc_message.h

Issue 283623002: Add support for passing an arbitrary parameter to an IPC message handler. The motivation is for Web… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget_unittest.cc ('k') | ipc/ipc_message_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message.h
===================================================================
--- ipc/ipc_message.h (revision 270218)
+++ ipc/ipc_message.h (working copy)
@@ -141,34 +141,20 @@
// call.
void SetHeaderValues(int32 routing, uint32 type, uint32 flags);
- template<class T, class S>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
+ template<class T, class S, class P>
+ static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter,
void (T::*func)()) {
(obj->*func)();
return true;
}
- template<class T, class S>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
- void (T::*func)() const) {
- (obj->*func)();
+ template<class T, class S, class P>
+ static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter,
+ void (T::*func)(P*)) {
+ (obj->*func)(parameter);
return true;
}
- template<class T, class S>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
- void (T::*func)(const Message&)) {
- (obj->*func)(*msg);
- return true;
- }
-
- template<class T, class S>
- static bool Dispatch(const Message* msg, T* obj, S* sender,
- void (T::*func)(const Message&) const) {
- (obj->*func)(*msg);
- return true;
- }
-
// Used for async messages with no parameters.
static void Log(std::string* name, const Message* msg, std::string* l) {
}
« no previous file with comments | « content/renderer/render_widget_unittest.cc ('k') | ipc/ipc_message_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698