Remove all npapi plugins from windows metro chrome
[chromium-blink-merge.git] / base / bind_internal_win.h.pump
bloba557a29b01c028ad1d63373911fa54df9a2b326f
1 $$ This is a pump file for generating file templates.  Pump is a python
2 $$ script that is part of the Google Test suite of utilities.  Description
3 $$ can be found here:
4 $$
5 $$ http://code.google.com/p/googletest/wiki/PumpManual
6 $$
8 $$ See comment for MAX_ARITY in base/bind.h.pump.
9 $var MAX_ARITY = 7
11 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
12 // Use of this source code is governed by a BSD-style license that can be
13 // found in the LICENSE file.
15 // Specializations of RunnableAdapter<> for Windows specific calling
16 // conventions.  Please see base/bind_internal.h for more info.
18 #ifndef BASE_BIND_INTERNAL_WIN_H_
19 #define BASE_BIND_INTERNAL_WIN_H_
20 #pragma once
22 // In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all
23 // the same as __cdecl which would turn the following specializations into
24 // multiple definitions.
25 #if !defined(ARCH_CPU_X86_64)
27 namespace base {
28 namespace internal {
30 template <typename Functor>
31 class RunnableAdapter;
33 $range ARITY 0..MAX_ARITY
34 $for ARITY [[
35 $range ARG 1..ARITY
37 // __stdcall Function: Arity $(ARITY).
38 template <typename R[[]]
39 $if ARITY > 0[[, ]] $for ARG , [[typename A$(ARG)]]>
40 class RunnableAdapter<R(__stdcall *)($for ARG , [[A$(ARG)]])> {
41  public:
42   typedef R (RunType)($for ARG , [[A$(ARG)]]);
44   explicit RunnableAdapter(R(__stdcall *function)($for ARG , [[A$(ARG)]]))
45       : function_(function) {
46   }
48   R Run($for ARG , [[typename CallbackParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) {
49     return function_($for ARG , [[a$(ARG)]]);
50   }
52  private:
53   R (__stdcall *function_)($for ARG , [[A$(ARG)]]);
56 // __fastcall Function: Arity $(ARITY).
57 template <typename R[[]]
58 $if ARITY > 0[[, ]] $for ARG , [[typename A$(ARG)]]>
59 class RunnableAdapter<R(__fastcall *)($for ARG , [[A$(ARG)]])> {
60  public:
61   typedef R (RunType)($for ARG , [[A$(ARG)]]);
63   explicit RunnableAdapter(R(__fastcall *function)($for ARG , [[A$(ARG)]]))
64       : function_(function) {
65   }
67   R Run($for ARG , [[typename CallbackParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) {
68     return function_($for ARG , [[a$(ARG)]]);
69   }
71  private:
72   R (__fastcall *function_)($for ARG , [[A$(ARG)]]);
75 ]]  $$for ARITY
77 }  // namespace internal
78 }  // namespace base
80 #endif  // !defined(ARCH_CPU_X86_64)
82 #endif  // BASE_BIND_INTERNAL_WIN_H_