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

Side by Side Diff: ppapi/proxy/dispatch_reply_message.h

Issue 1159553007: Move Tuple to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « ppapi/host/dispatch_host_message.h ('k') | ppapi/proxy/nacl_message_scanner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file provides infrastructure for dispatching messasges from host 5 // This file provides infrastructure for dispatching messasges from host
6 // resource, inlcuding reply messages or unsolicited replies. Normal IPC Reply 6 // resource, inlcuding reply messages or unsolicited replies. Normal IPC Reply
7 // handlers can't take extra parameters. We want to take a 7 // handlers can't take extra parameters. We want to take a
8 // ResourceMessageReplyParams as a parameter. 8 // ResourceMessageReplyParams as a parameter.
9 9
10 #ifndef PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ 10 #ifndef PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_
11 #define PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ 11 #define PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "ipc/ipc_message_macros.h" 14 #include "ipc/ipc_message_macros.h"
15 #include "ppapi/c/pp_errors.h" 15 #include "ppapi/c/pp_errors.h"
16 16
17 namespace ppapi { 17 namespace ppapi {
18 namespace proxy { 18 namespace proxy {
19 19
20 class ResourceMessageReplyParams; 20 class ResourceMessageReplyParams;
21 21
22 template <class ObjT, class Method> 22 template <class ObjT, class Method>
23 inline void DispatchResourceReply(ObjT* obj, Method method, 23 inline void DispatchResourceReply(ObjT* obj, Method method,
24 const ResourceMessageReplyParams& params, 24 const ResourceMessageReplyParams& params,
25 const Tuple<>& arg) { 25 const base::Tuple<>& arg) {
26 (obj->*method)(params); 26 (obj->*method)(params);
27 } 27 }
28 28
29 template <class ObjT, class Method, class A> 29 template <class ObjT, class Method, class A>
30 inline void DispatchResourceReply(ObjT* obj, Method method, 30 inline void DispatchResourceReply(ObjT* obj, Method method,
31 const ResourceMessageReplyParams& params, 31 const ResourceMessageReplyParams& params,
32 const Tuple<A>& arg) { 32 const base::Tuple<A>& arg) {
33 (obj->*method)(params, get<0>(arg)); 33 (obj->*method)(params, base::get<0>(arg));
34 } 34 }
35 35
36 template<class ObjT, class Method, class A, class B> 36 template<class ObjT, class Method, class A, class B>
37 inline void DispatchResourceReply(ObjT* obj, Method method, 37 inline void DispatchResourceReply(ObjT* obj, Method method,
38 const ResourceMessageReplyParams& params, 38 const ResourceMessageReplyParams& params,
39 const Tuple<A, B>& arg) { 39 const base::Tuple<A, B>& arg) {
40 (obj->*method)(params, get<0>(arg), get<1>(arg)); 40 (obj->*method)(params, base::get<0>(arg), base::get<1>(arg));
41 } 41 }
42 42
43 template<class ObjT, class Method, class A, class B, class C> 43 template<class ObjT, class Method, class A, class B, class C>
44 inline void DispatchResourceReply(ObjT* obj, Method method, 44 inline void DispatchResourceReply(ObjT* obj, Method method,
45 const ResourceMessageReplyParams& params, 45 const ResourceMessageReplyParams& params,
46 const Tuple<A, B, C>& arg) { 46 const base::Tuple<A, B, C>& arg) {
47 (obj->*method)(params, get<0>(arg), get<1>(arg), get<2>(arg)); 47 (obj->*method)(params, base::get<0>(arg), base::get<1>(arg),
48 base::get<2>(arg));
48 } 49 }
49 50
50 template<class ObjT, class Method, class A, class B, class C, class D> 51 template<class ObjT, class Method, class A, class B, class C, class D>
51 inline void DispatchResourceReply(ObjT* obj, Method method, 52 inline void DispatchResourceReply(ObjT* obj, Method method,
52 const ResourceMessageReplyParams& params, 53 const ResourceMessageReplyParams& params,
53 const Tuple<A, B, C, D>& arg) { 54 const base::Tuple<A, B, C, D>& arg) {
54 (obj->*method)(params, get<0>(arg), get<1>(arg), get<2>(arg), get<3>(arg)); 55 (obj->*method)(params, base::get<0>(arg), base::get<1>(arg),
56 base::get<2>(arg), base::get<3>(arg));
55 } 57 }
56 58
57 template<class ObjT, class Method, class A, class B, class C, class D, class E> 59 template<class ObjT, class Method, class A, class B, class C, class D, class E>
58 inline void DispatchResourceReply(ObjT* obj, Method method, 60 inline void DispatchResourceReply(ObjT* obj, Method method,
59 const ResourceMessageReplyParams& params, 61 const ResourceMessageReplyParams& params,
60 const Tuple<A, B, C, D, E>& arg) { 62 const base::Tuple<A, B, C, D, E>& arg) {
61 (obj->*method)(params, get<0>(arg), get<1>(arg), get<2>(arg), get<3>(arg), 63 (obj->*method)(params, base::get<0>(arg), base::get<1>(arg),
62 get<4>(arg)); 64 base::get<2>(arg), base::get<3>(arg), base::get<4>(arg));
63 } 65 }
64 66
65 // Used to dispatch resource replies. In most cases, you should not call this 67 // Used to dispatch resource replies. In most cases, you should not call this
66 // function to dispatch a resource reply manually, but instead use 68 // function to dispatch a resource reply manually, but instead use
67 // |PluginResource::CallBrowser|/|PluginResource::CallRenderer| with a 69 // |PluginResource::CallBrowser|/|PluginResource::CallRenderer| with a
68 // |base::Callback| which will be called when a reply message is received 70 // |base::Callback| which will be called when a reply message is received
69 // (see plugin_resource.h). 71 // (see plugin_resource.h).
70 // 72 //
71 // This function will call your callback with the nested reply message's 73 // This function will call your callback with the nested reply message's
72 // parameters on success. On failure, your callback will be called with each 74 // parameters on success. On failure, your callback will be called with each
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 break; 171 break;
170 172
171 #define PPAPI_END_MESSAGE_MAP() \ 173 #define PPAPI_END_MESSAGE_MAP() \
172 } \ 174 } \
173 } 175 }
174 176
175 } // namespace proxy 177 } // namespace proxy
176 } // namespace ppapi 178 } // namespace ppapi
177 179
178 #endif // PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_ 180 #endif // PPAPI_PROXY_DISPATCH_REPLY_MESSAGE_H_
OLDNEW
« no previous file with comments | « ppapi/host/dispatch_host_message.h ('k') | ppapi/proxy/nacl_message_scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698