Revert of Class for allocating a chunk of memory for RenderPass (patchset #31 id...
[chromium-blink-merge.git] / base / bind_internal_win.h
blob7a8486a30927f481f0df7a1d5d235af6b9218def
1 // This file was GENERATED by command:
2 // pump.py bind_internal_win.h.pump
3 // DO NOT EDIT BY HAND!!!
6 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file.
10 // Specializations of RunnableAdapter<> for Windows specific calling
11 // conventions. Please see base/bind_internal.h for more info.
13 #ifndef BASE_BIND_INTERNAL_WIN_H_
14 #define BASE_BIND_INTERNAL_WIN_H_
16 // In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all
17 // the same as __cdecl which would turn the following specializations into
18 // multiple definitions.
19 #if !defined(ARCH_CPU_X86_64)
21 namespace base {
22 namespace internal {
24 template <typename Functor>
25 class RunnableAdapter;
27 // __stdcall Function: Arity 0.
28 template <typename R>
29 class RunnableAdapter<R(__stdcall *)()> {
30 public:
31 typedef R (RunType)();
33 explicit RunnableAdapter(R(__stdcall *function)())
34 : function_(function) {
37 R Run() {
38 return function_();
41 private:
42 R (__stdcall *function_)();
45 // __fastcall Function: Arity 0.
46 template <typename R>
47 class RunnableAdapter<R(__fastcall *)()> {
48 public:
49 typedef R (RunType)();
51 explicit RunnableAdapter(R(__fastcall *function)())
52 : function_(function) {
55 R Run() {
56 return function_();
59 private:
60 R (__fastcall *function_)();
63 // __stdcall Function: Arity 1.
64 template <typename R, typename A1>
65 class RunnableAdapter<R(__stdcall *)(A1)> {
66 public:
67 typedef R (RunType)(A1);
69 explicit RunnableAdapter(R(__stdcall *function)(A1))
70 : function_(function) {
73 R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
74 return function_(a1);
77 private:
78 R (__stdcall *function_)(A1);
81 // __fastcall Function: Arity 1.
82 template <typename R, typename A1>
83 class RunnableAdapter<R(__fastcall *)(A1)> {
84 public:
85 typedef R (RunType)(A1);
87 explicit RunnableAdapter(R(__fastcall *function)(A1))
88 : function_(function) {
91 R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
92 return function_(a1);
95 private:
96 R (__fastcall *function_)(A1);
99 // __stdcall Function: Arity 2.
100 template <typename R, typename A1, typename A2>
101 class RunnableAdapter<R(__stdcall *)(A1, A2)> {
102 public:
103 typedef R (RunType)(A1, A2);
105 explicit RunnableAdapter(R(__stdcall *function)(A1, A2))
106 : function_(function) {
109 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
110 typename CallbackParamTraits<A2>::ForwardType a2) {
111 return function_(a1, a2);
114 private:
115 R (__stdcall *function_)(A1, A2);
118 // __fastcall Function: Arity 2.
119 template <typename R, typename A1, typename A2>
120 class RunnableAdapter<R(__fastcall *)(A1, A2)> {
121 public:
122 typedef R (RunType)(A1, A2);
124 explicit RunnableAdapter(R(__fastcall *function)(A1, A2))
125 : function_(function) {
128 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
129 typename CallbackParamTraits<A2>::ForwardType a2) {
130 return function_(a1, a2);
133 private:
134 R (__fastcall *function_)(A1, A2);
137 // __stdcall Function: Arity 3.
138 template <typename R, typename A1, typename A2, typename A3>
139 class RunnableAdapter<R(__stdcall *)(A1, A2, A3)> {
140 public:
141 typedef R (RunType)(A1, A2, A3);
143 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3))
144 : function_(function) {
147 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
148 typename CallbackParamTraits<A2>::ForwardType a2,
149 typename CallbackParamTraits<A3>::ForwardType a3) {
150 return function_(a1, a2, a3);
153 private:
154 R (__stdcall *function_)(A1, A2, A3);
157 // __fastcall Function: Arity 3.
158 template <typename R, typename A1, typename A2, typename A3>
159 class RunnableAdapter<R(__fastcall *)(A1, A2, A3)> {
160 public:
161 typedef R (RunType)(A1, A2, A3);
163 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3))
164 : function_(function) {
167 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
168 typename CallbackParamTraits<A2>::ForwardType a2,
169 typename CallbackParamTraits<A3>::ForwardType a3) {
170 return function_(a1, a2, a3);
173 private:
174 R (__fastcall *function_)(A1, A2, A3);
177 // __stdcall Function: Arity 4.
178 template <typename R, typename A1, typename A2, typename A3, typename A4>
179 class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4)> {
180 public:
181 typedef R (RunType)(A1, A2, A3, A4);
183 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4))
184 : function_(function) {
187 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
188 typename CallbackParamTraits<A2>::ForwardType a2,
189 typename CallbackParamTraits<A3>::ForwardType a3,
190 typename CallbackParamTraits<A4>::ForwardType a4) {
191 return function_(a1, a2, a3, a4);
194 private:
195 R (__stdcall *function_)(A1, A2, A3, A4);
198 // __fastcall Function: Arity 4.
199 template <typename R, typename A1, typename A2, typename A3, typename A4>
200 class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4)> {
201 public:
202 typedef R (RunType)(A1, A2, A3, A4);
204 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4))
205 : function_(function) {
208 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
209 typename CallbackParamTraits<A2>::ForwardType a2,
210 typename CallbackParamTraits<A3>::ForwardType a3,
211 typename CallbackParamTraits<A4>::ForwardType a4) {
212 return function_(a1, a2, a3, a4);
215 private:
216 R (__fastcall *function_)(A1, A2, A3, A4);
219 // __stdcall Function: Arity 5.
220 template <typename R, typename A1, typename A2, typename A3, typename A4,
221 typename A5>
222 class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5)> {
223 public:
224 typedef R (RunType)(A1, A2, A3, A4, A5);
226 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5))
227 : function_(function) {
230 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
231 typename CallbackParamTraits<A2>::ForwardType a2,
232 typename CallbackParamTraits<A3>::ForwardType a3,
233 typename CallbackParamTraits<A4>::ForwardType a4,
234 typename CallbackParamTraits<A5>::ForwardType a5) {
235 return function_(a1, a2, a3, a4, a5);
238 private:
239 R (__stdcall *function_)(A1, A2, A3, A4, A5);
242 // __fastcall Function: Arity 5.
243 template <typename R, typename A1, typename A2, typename A3, typename A4,
244 typename A5>
245 class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5)> {
246 public:
247 typedef R (RunType)(A1, A2, A3, A4, A5);
249 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5))
250 : function_(function) {
253 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
254 typename CallbackParamTraits<A2>::ForwardType a2,
255 typename CallbackParamTraits<A3>::ForwardType a3,
256 typename CallbackParamTraits<A4>::ForwardType a4,
257 typename CallbackParamTraits<A5>::ForwardType a5) {
258 return function_(a1, a2, a3, a4, a5);
261 private:
262 R (__fastcall *function_)(A1, A2, A3, A4, A5);
265 // __stdcall Function: Arity 6.
266 template <typename R, typename A1, typename A2, typename A3, typename A4,
267 typename A5, typename A6>
268 class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6)> {
269 public:
270 typedef R (RunType)(A1, A2, A3, A4, A5, A6);
272 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6))
273 : function_(function) {
276 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
277 typename CallbackParamTraits<A2>::ForwardType a2,
278 typename CallbackParamTraits<A3>::ForwardType a3,
279 typename CallbackParamTraits<A4>::ForwardType a4,
280 typename CallbackParamTraits<A5>::ForwardType a5,
281 typename CallbackParamTraits<A6>::ForwardType a6) {
282 return function_(a1, a2, a3, a4, a5, a6);
285 private:
286 R (__stdcall *function_)(A1, A2, A3, A4, A5, A6);
289 // __fastcall Function: Arity 6.
290 template <typename R, typename A1, typename A2, typename A3, typename A4,
291 typename A5, typename A6>
292 class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6)> {
293 public:
294 typedef R (RunType)(A1, A2, A3, A4, A5, A6);
296 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6))
297 : function_(function) {
300 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
301 typename CallbackParamTraits<A2>::ForwardType a2,
302 typename CallbackParamTraits<A3>::ForwardType a3,
303 typename CallbackParamTraits<A4>::ForwardType a4,
304 typename CallbackParamTraits<A5>::ForwardType a5,
305 typename CallbackParamTraits<A6>::ForwardType a6) {
306 return function_(a1, a2, a3, a4, a5, a6);
309 private:
310 R (__fastcall *function_)(A1, A2, A3, A4, A5, A6);
313 // __stdcall Function: Arity 7.
314 template <typename R, typename A1, typename A2, typename A3, typename A4,
315 typename A5, typename A6, typename A7>
316 class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7)> {
317 public:
318 typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
320 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7))
321 : function_(function) {
324 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
325 typename CallbackParamTraits<A2>::ForwardType a2,
326 typename CallbackParamTraits<A3>::ForwardType a3,
327 typename CallbackParamTraits<A4>::ForwardType a4,
328 typename CallbackParamTraits<A5>::ForwardType a5,
329 typename CallbackParamTraits<A6>::ForwardType a6,
330 typename CallbackParamTraits<A7>::ForwardType a7) {
331 return function_(a1, a2, a3, a4, a5, a6, a7);
334 private:
335 R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7);
338 // __fastcall Function: Arity 7.
339 template <typename R, typename A1, typename A2, typename A3, typename A4,
340 typename A5, typename A6, typename A7>
341 class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7)> {
342 public:
343 typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
345 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7))
346 : function_(function) {
349 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
350 typename CallbackParamTraits<A2>::ForwardType a2,
351 typename CallbackParamTraits<A3>::ForwardType a3,
352 typename CallbackParamTraits<A4>::ForwardType a4,
353 typename CallbackParamTraits<A5>::ForwardType a5,
354 typename CallbackParamTraits<A6>::ForwardType a6,
355 typename CallbackParamTraits<A7>::ForwardType a7) {
356 return function_(a1, a2, a3, a4, a5, a6, a7);
359 private:
360 R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7);
363 } // namespace internal
364 } // namespace base
366 #endif // !defined(ARCH_CPU_X86_64)
368 #endif // BASE_BIND_INTERNAL_WIN_H_