Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | // This file was GENERATED by command: |
michael@0 | 2 | // pump.py bind_internal_win.h.pump |
michael@0 | 3 | // DO NOT EDIT BY HAND!!! |
michael@0 | 4 | |
michael@0 | 5 | |
michael@0 | 6 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
michael@0 | 7 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 8 | // found in the LICENSE file. |
michael@0 | 9 | |
michael@0 | 10 | // Specializations of RunnableAdapter<> for Windows specific calling |
michael@0 | 11 | // conventions. Please see base/bind_internal.h for more info. |
michael@0 | 12 | |
michael@0 | 13 | #ifndef BASE_BIND_INTERNAL_WIN_H_ |
michael@0 | 14 | #define BASE_BIND_INTERNAL_WIN_H_ |
michael@0 | 15 | |
michael@0 | 16 | // In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all |
michael@0 | 17 | // the same as __cdecl which would turn the following specializations into |
michael@0 | 18 | // multiple definitions. |
michael@0 | 19 | #if !defined(ARCH_CPU_X86_64) |
michael@0 | 20 | |
michael@0 | 21 | namespace base { |
michael@0 | 22 | namespace internal { |
michael@0 | 23 | |
michael@0 | 24 | template <typename Functor> |
michael@0 | 25 | class RunnableAdapter; |
michael@0 | 26 | |
michael@0 | 27 | // __stdcall Function: Arity 0. |
michael@0 | 28 | template <typename R> |
michael@0 | 29 | class RunnableAdapter<R(__stdcall *)()> { |
michael@0 | 30 | public: |
michael@0 | 31 | typedef R (RunType)(); |
michael@0 | 32 | |
michael@0 | 33 | explicit RunnableAdapter(R(__stdcall *function)()) |
michael@0 | 34 | : function_(function) { |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | R Run() { |
michael@0 | 38 | return function_(); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | private: |
michael@0 | 42 | R (__stdcall *function_)(); |
michael@0 | 43 | }; |
michael@0 | 44 | |
michael@0 | 45 | // __fastcall Function: Arity 0. |
michael@0 | 46 | template <typename R> |
michael@0 | 47 | class RunnableAdapter<R(__fastcall *)()> { |
michael@0 | 48 | public: |
michael@0 | 49 | typedef R (RunType)(); |
michael@0 | 50 | |
michael@0 | 51 | explicit RunnableAdapter(R(__fastcall *function)()) |
michael@0 | 52 | : function_(function) { |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | R Run() { |
michael@0 | 56 | return function_(); |
michael@0 | 57 | } |
michael@0 | 58 | |
michael@0 | 59 | private: |
michael@0 | 60 | R (__fastcall *function_)(); |
michael@0 | 61 | }; |
michael@0 | 62 | |
michael@0 | 63 | // __stdcall Function: Arity 1. |
michael@0 | 64 | template <typename R, typename A1> |
michael@0 | 65 | class RunnableAdapter<R(__stdcall *)(A1)> { |
michael@0 | 66 | public: |
michael@0 | 67 | typedef R (RunType)(A1); |
michael@0 | 68 | |
michael@0 | 69 | explicit RunnableAdapter(R(__stdcall *function)(A1)) |
michael@0 | 70 | : function_(function) { |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | R Run(typename CallbackParamTraits<A1>::ForwardType a1) { |
michael@0 | 74 | return function_(a1); |
michael@0 | 75 | } |
michael@0 | 76 | |
michael@0 | 77 | private: |
michael@0 | 78 | R (__stdcall *function_)(A1); |
michael@0 | 79 | }; |
michael@0 | 80 | |
michael@0 | 81 | // __fastcall Function: Arity 1. |
michael@0 | 82 | template <typename R, typename A1> |
michael@0 | 83 | class RunnableAdapter<R(__fastcall *)(A1)> { |
michael@0 | 84 | public: |
michael@0 | 85 | typedef R (RunType)(A1); |
michael@0 | 86 | |
michael@0 | 87 | explicit RunnableAdapter(R(__fastcall *function)(A1)) |
michael@0 | 88 | : function_(function) { |
michael@0 | 89 | } |
michael@0 | 90 | |
michael@0 | 91 | R Run(typename CallbackParamTraits<A1>::ForwardType a1) { |
michael@0 | 92 | return function_(a1); |
michael@0 | 93 | } |
michael@0 | 94 | |
michael@0 | 95 | private: |
michael@0 | 96 | R (__fastcall *function_)(A1); |
michael@0 | 97 | }; |
michael@0 | 98 | |
michael@0 | 99 | // __stdcall Function: Arity 2. |
michael@0 | 100 | template <typename R, typename A1, typename A2> |
michael@0 | 101 | class RunnableAdapter<R(__stdcall *)(A1, A2)> { |
michael@0 | 102 | public: |
michael@0 | 103 | typedef R (RunType)(A1, A2); |
michael@0 | 104 | |
michael@0 | 105 | explicit RunnableAdapter(R(__stdcall *function)(A1, A2)) |
michael@0 | 106 | : function_(function) { |
michael@0 | 107 | } |
michael@0 | 108 | |
michael@0 | 109 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 110 | typename CallbackParamTraits<A2>::ForwardType a2) { |
michael@0 | 111 | return function_(a1, a2); |
michael@0 | 112 | } |
michael@0 | 113 | |
michael@0 | 114 | private: |
michael@0 | 115 | R (__stdcall *function_)(A1, A2); |
michael@0 | 116 | }; |
michael@0 | 117 | |
michael@0 | 118 | // __fastcall Function: Arity 2. |
michael@0 | 119 | template <typename R, typename A1, typename A2> |
michael@0 | 120 | class RunnableAdapter<R(__fastcall *)(A1, A2)> { |
michael@0 | 121 | public: |
michael@0 | 122 | typedef R (RunType)(A1, A2); |
michael@0 | 123 | |
michael@0 | 124 | explicit RunnableAdapter(R(__fastcall *function)(A1, A2)) |
michael@0 | 125 | : function_(function) { |
michael@0 | 126 | } |
michael@0 | 127 | |
michael@0 | 128 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 129 | typename CallbackParamTraits<A2>::ForwardType a2) { |
michael@0 | 130 | return function_(a1, a2); |
michael@0 | 131 | } |
michael@0 | 132 | |
michael@0 | 133 | private: |
michael@0 | 134 | R (__fastcall *function_)(A1, A2); |
michael@0 | 135 | }; |
michael@0 | 136 | |
michael@0 | 137 | // __stdcall Function: Arity 3. |
michael@0 | 138 | template <typename R, typename A1, typename A2, typename A3> |
michael@0 | 139 | class RunnableAdapter<R(__stdcall *)(A1, A2, A3)> { |
michael@0 | 140 | public: |
michael@0 | 141 | typedef R (RunType)(A1, A2, A3); |
michael@0 | 142 | |
michael@0 | 143 | explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3)) |
michael@0 | 144 | : function_(function) { |
michael@0 | 145 | } |
michael@0 | 146 | |
michael@0 | 147 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 148 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 149 | typename CallbackParamTraits<A3>::ForwardType a3) { |
michael@0 | 150 | return function_(a1, a2, a3); |
michael@0 | 151 | } |
michael@0 | 152 | |
michael@0 | 153 | private: |
michael@0 | 154 | R (__stdcall *function_)(A1, A2, A3); |
michael@0 | 155 | }; |
michael@0 | 156 | |
michael@0 | 157 | // __fastcall Function: Arity 3. |
michael@0 | 158 | template <typename R, typename A1, typename A2, typename A3> |
michael@0 | 159 | class RunnableAdapter<R(__fastcall *)(A1, A2, A3)> { |
michael@0 | 160 | public: |
michael@0 | 161 | typedef R (RunType)(A1, A2, A3); |
michael@0 | 162 | |
michael@0 | 163 | explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3)) |
michael@0 | 164 | : function_(function) { |
michael@0 | 165 | } |
michael@0 | 166 | |
michael@0 | 167 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 168 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 169 | typename CallbackParamTraits<A3>::ForwardType a3) { |
michael@0 | 170 | return function_(a1, a2, a3); |
michael@0 | 171 | } |
michael@0 | 172 | |
michael@0 | 173 | private: |
michael@0 | 174 | R (__fastcall *function_)(A1, A2, A3); |
michael@0 | 175 | }; |
michael@0 | 176 | |
michael@0 | 177 | // __stdcall Function: Arity 4. |
michael@0 | 178 | template <typename R, typename A1, typename A2, typename A3, typename A4> |
michael@0 | 179 | class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4)> { |
michael@0 | 180 | public: |
michael@0 | 181 | typedef R (RunType)(A1, A2, A3, A4); |
michael@0 | 182 | |
michael@0 | 183 | explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4)) |
michael@0 | 184 | : function_(function) { |
michael@0 | 185 | } |
michael@0 | 186 | |
michael@0 | 187 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 188 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 189 | typename CallbackParamTraits<A3>::ForwardType a3, |
michael@0 | 190 | typename CallbackParamTraits<A4>::ForwardType a4) { |
michael@0 | 191 | return function_(a1, a2, a3, a4); |
michael@0 | 192 | } |
michael@0 | 193 | |
michael@0 | 194 | private: |
michael@0 | 195 | R (__stdcall *function_)(A1, A2, A3, A4); |
michael@0 | 196 | }; |
michael@0 | 197 | |
michael@0 | 198 | // __fastcall Function: Arity 4. |
michael@0 | 199 | template <typename R, typename A1, typename A2, typename A3, typename A4> |
michael@0 | 200 | class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4)> { |
michael@0 | 201 | public: |
michael@0 | 202 | typedef R (RunType)(A1, A2, A3, A4); |
michael@0 | 203 | |
michael@0 | 204 | explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4)) |
michael@0 | 205 | : function_(function) { |
michael@0 | 206 | } |
michael@0 | 207 | |
michael@0 | 208 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 209 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 210 | typename CallbackParamTraits<A3>::ForwardType a3, |
michael@0 | 211 | typename CallbackParamTraits<A4>::ForwardType a4) { |
michael@0 | 212 | return function_(a1, a2, a3, a4); |
michael@0 | 213 | } |
michael@0 | 214 | |
michael@0 | 215 | private: |
michael@0 | 216 | R (__fastcall *function_)(A1, A2, A3, A4); |
michael@0 | 217 | }; |
michael@0 | 218 | |
michael@0 | 219 | // __stdcall Function: Arity 5. |
michael@0 | 220 | template <typename R, typename A1, typename A2, typename A3, typename A4, |
michael@0 | 221 | typename A5> |
michael@0 | 222 | class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5)> { |
michael@0 | 223 | public: |
michael@0 | 224 | typedef R (RunType)(A1, A2, A3, A4, A5); |
michael@0 | 225 | |
michael@0 | 226 | explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5)) |
michael@0 | 227 | : function_(function) { |
michael@0 | 228 | } |
michael@0 | 229 | |
michael@0 | 230 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 231 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 232 | typename CallbackParamTraits<A3>::ForwardType a3, |
michael@0 | 233 | typename CallbackParamTraits<A4>::ForwardType a4, |
michael@0 | 234 | typename CallbackParamTraits<A5>::ForwardType a5) { |
michael@0 | 235 | return function_(a1, a2, a3, a4, a5); |
michael@0 | 236 | } |
michael@0 | 237 | |
michael@0 | 238 | private: |
michael@0 | 239 | R (__stdcall *function_)(A1, A2, A3, A4, A5); |
michael@0 | 240 | }; |
michael@0 | 241 | |
michael@0 | 242 | // __fastcall Function: Arity 5. |
michael@0 | 243 | template <typename R, typename A1, typename A2, typename A3, typename A4, |
michael@0 | 244 | typename A5> |
michael@0 | 245 | class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5)> { |
michael@0 | 246 | public: |
michael@0 | 247 | typedef R (RunType)(A1, A2, A3, A4, A5); |
michael@0 | 248 | |
michael@0 | 249 | explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5)) |
michael@0 | 250 | : function_(function) { |
michael@0 | 251 | } |
michael@0 | 252 | |
michael@0 | 253 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 254 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 255 | typename CallbackParamTraits<A3>::ForwardType a3, |
michael@0 | 256 | typename CallbackParamTraits<A4>::ForwardType a4, |
michael@0 | 257 | typename CallbackParamTraits<A5>::ForwardType a5) { |
michael@0 | 258 | return function_(a1, a2, a3, a4, a5); |
michael@0 | 259 | } |
michael@0 | 260 | |
michael@0 | 261 | private: |
michael@0 | 262 | R (__fastcall *function_)(A1, A2, A3, A4, A5); |
michael@0 | 263 | }; |
michael@0 | 264 | |
michael@0 | 265 | // __stdcall Function: Arity 6. |
michael@0 | 266 | template <typename R, typename A1, typename A2, typename A3, typename A4, |
michael@0 | 267 | typename A5, typename A6> |
michael@0 | 268 | class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6)> { |
michael@0 | 269 | public: |
michael@0 | 270 | typedef R (RunType)(A1, A2, A3, A4, A5, A6); |
michael@0 | 271 | |
michael@0 | 272 | explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6)) |
michael@0 | 273 | : function_(function) { |
michael@0 | 274 | } |
michael@0 | 275 | |
michael@0 | 276 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 277 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 278 | typename CallbackParamTraits<A3>::ForwardType a3, |
michael@0 | 279 | typename CallbackParamTraits<A4>::ForwardType a4, |
michael@0 | 280 | typename CallbackParamTraits<A5>::ForwardType a5, |
michael@0 | 281 | typename CallbackParamTraits<A6>::ForwardType a6) { |
michael@0 | 282 | return function_(a1, a2, a3, a4, a5, a6); |
michael@0 | 283 | } |
michael@0 | 284 | |
michael@0 | 285 | private: |
michael@0 | 286 | R (__stdcall *function_)(A1, A2, A3, A4, A5, A6); |
michael@0 | 287 | }; |
michael@0 | 288 | |
michael@0 | 289 | // __fastcall Function: Arity 6. |
michael@0 | 290 | template <typename R, typename A1, typename A2, typename A3, typename A4, |
michael@0 | 291 | typename A5, typename A6> |
michael@0 | 292 | class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6)> { |
michael@0 | 293 | public: |
michael@0 | 294 | typedef R (RunType)(A1, A2, A3, A4, A5, A6); |
michael@0 | 295 | |
michael@0 | 296 | explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6)) |
michael@0 | 297 | : function_(function) { |
michael@0 | 298 | } |
michael@0 | 299 | |
michael@0 | 300 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 301 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 302 | typename CallbackParamTraits<A3>::ForwardType a3, |
michael@0 | 303 | typename CallbackParamTraits<A4>::ForwardType a4, |
michael@0 | 304 | typename CallbackParamTraits<A5>::ForwardType a5, |
michael@0 | 305 | typename CallbackParamTraits<A6>::ForwardType a6) { |
michael@0 | 306 | return function_(a1, a2, a3, a4, a5, a6); |
michael@0 | 307 | } |
michael@0 | 308 | |
michael@0 | 309 | private: |
michael@0 | 310 | R (__fastcall *function_)(A1, A2, A3, A4, A5, A6); |
michael@0 | 311 | }; |
michael@0 | 312 | |
michael@0 | 313 | // __stdcall Function: Arity 7. |
michael@0 | 314 | template <typename R, typename A1, typename A2, typename A3, typename A4, |
michael@0 | 315 | typename A5, typename A6, typename A7> |
michael@0 | 316 | class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7)> { |
michael@0 | 317 | public: |
michael@0 | 318 | typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); |
michael@0 | 319 | |
michael@0 | 320 | explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7)) |
michael@0 | 321 | : function_(function) { |
michael@0 | 322 | } |
michael@0 | 323 | |
michael@0 | 324 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 325 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 326 | typename CallbackParamTraits<A3>::ForwardType a3, |
michael@0 | 327 | typename CallbackParamTraits<A4>::ForwardType a4, |
michael@0 | 328 | typename CallbackParamTraits<A5>::ForwardType a5, |
michael@0 | 329 | typename CallbackParamTraits<A6>::ForwardType a6, |
michael@0 | 330 | typename CallbackParamTraits<A7>::ForwardType a7) { |
michael@0 | 331 | return function_(a1, a2, a3, a4, a5, a6, a7); |
michael@0 | 332 | } |
michael@0 | 333 | |
michael@0 | 334 | private: |
michael@0 | 335 | R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7); |
michael@0 | 336 | }; |
michael@0 | 337 | |
michael@0 | 338 | // __fastcall Function: Arity 7. |
michael@0 | 339 | template <typename R, typename A1, typename A2, typename A3, typename A4, |
michael@0 | 340 | typename A5, typename A6, typename A7> |
michael@0 | 341 | class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7)> { |
michael@0 | 342 | public: |
michael@0 | 343 | typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); |
michael@0 | 344 | |
michael@0 | 345 | explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7)) |
michael@0 | 346 | : function_(function) { |
michael@0 | 347 | } |
michael@0 | 348 | |
michael@0 | 349 | R Run(typename CallbackParamTraits<A1>::ForwardType a1, |
michael@0 | 350 | typename CallbackParamTraits<A2>::ForwardType a2, |
michael@0 | 351 | typename CallbackParamTraits<A3>::ForwardType a3, |
michael@0 | 352 | typename CallbackParamTraits<A4>::ForwardType a4, |
michael@0 | 353 | typename CallbackParamTraits<A5>::ForwardType a5, |
michael@0 | 354 | typename CallbackParamTraits<A6>::ForwardType a6, |
michael@0 | 355 | typename CallbackParamTraits<A7>::ForwardType a7) { |
michael@0 | 356 | return function_(a1, a2, a3, a4, a5, a6, a7); |
michael@0 | 357 | } |
michael@0 | 358 | |
michael@0 | 359 | private: |
michael@0 | 360 | R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7); |
michael@0 | 361 | }; |
michael@0 | 362 | |
michael@0 | 363 | } // namespace internal |
michael@0 | 364 | } // namespace base |
michael@0 | 365 | |
michael@0 | 366 | #endif // !defined(ARCH_CPU_X86_64) |
michael@0 | 367 | |
michael@0 | 368 | #endif // BASE_BIND_INTERNAL_WIN_H_ |