| OLD | NEW |
| 1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
| 2 // pump.py bind.h.pump | 2 // pump.py bind.h.pump |
| 3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
| 4 | 4 |
| 5 | 5 |
| 6 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 7 // Use of this source code is governed by a BSD-style license that can be |
| 8 // found in the LICENSE file. | 8 // found in the LICENSE file. |
| 9 | 9 |
| 10 #ifndef BASE_BIND_H_ | 10 #ifndef BASE_BIND_H_ |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // TODO(ajwong): We might be able to avoid this now, but need to test. | 37 // TODO(ajwong): We might be able to avoid this now, but need to test. |
| 38 // | 38 // |
| 39 // It is possible to move most of the COMPILE_ASSERT asserts into BindState<>, | 39 // It is possible to move most of the COMPILE_ASSERT asserts into BindState<>, |
| 40 // but it feels a little nicer to have the asserts here so people do not | 40 // but it feels a little nicer to have the asserts here so people do not |
| 41 // need to crack open bind_internal.h. On the other hand, it makes Bind() | 41 // need to crack open bind_internal.h. On the other hand, it makes Bind() |
| 42 // harder to read. | 42 // harder to read. |
| 43 | 43 |
| 44 namespace base { | 44 namespace base { |
| 45 | 45 |
| 46 template <typename Functor> | 46 template <typename Functor> |
| 47 internal::BindStateHolder< | 47 base::Callback< |
| 48 internal::BindState< | 48 typename internal::BindState< |
| 49 typename internal::FunctorTraits<Functor>::RunnableType, | 49 typename internal::FunctorTraits<Functor>::RunnableType, |
| 50 typename internal::FunctorTraits<Functor>::RunType, | 50 typename internal::FunctorTraits<Functor>::RunType, |
| 51 void()> > | 51 void()> |
| 52 ::UnboundRunType> |
| 52 Bind(Functor functor) { | 53 Bind(Functor functor) { |
| 53 // Typedefs for how to store and run the functor. | 54 // Typedefs for how to store and run the functor. |
| 54 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 55 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
| 55 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 56 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
| 56 | 57 |
| 57 // Use RunnableType::RunType instead of RunType above because our | 58 // Use RunnableType::RunType instead of RunType above because our |
| 58 // checks should below for bound references need to know what the actual | 59 // checks should below for bound references need to know what the actual |
| 59 // functor is going to interpret the argument as. | 60 // functor is going to interpret the argument as. |
| 60 typedef internal::FunctionTraits<typename RunnableType::RunType> | 61 typedef internal::FunctionTraits<typename RunnableType::RunType> |
| 61 BoundFunctorTraits; | 62 BoundFunctorTraits; |
| 62 | 63 |
| 64 typedef internal::BindState<RunnableType, RunType, void()> BindState; |
| 63 | 65 |
| 64 return internal::MakeBindStateHolder( | 66 |
| 65 new internal::BindState<RunnableType, RunType, void()>( | 67 return Callback<typename BindState::UnboundRunType>( |
| 66 internal::MakeRunnable(functor))); | 68 new BindState(internal::MakeRunnable(functor))); |
| 67 } | 69 } |
| 68 | 70 |
| 69 template <typename Functor, typename P1> | 71 template <typename Functor, typename P1> |
| 70 internal::BindStateHolder< | 72 base::Callback< |
| 71 internal::BindState< | 73 typename internal::BindState< |
| 72 typename internal::FunctorTraits<Functor>::RunnableType, | 74 typename internal::FunctorTraits<Functor>::RunnableType, |
| 73 typename internal::FunctorTraits<Functor>::RunType, | 75 typename internal::FunctorTraits<Functor>::RunType, |
| 74 void(typename internal::CallbackParamTraits<P1>::StorageType)> > | 76 void(typename internal::CallbackParamTraits<P1>::StorageType)> |
| 77 ::UnboundRunType> |
| 75 Bind(Functor functor, const P1& p1) { | 78 Bind(Functor functor, const P1& p1) { |
| 76 // Typedefs for how to store and run the functor. | 79 // Typedefs for how to store and run the functor. |
| 77 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 80 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
| 78 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 81 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
| 79 | 82 |
| 80 // Use RunnableType::RunType instead of RunType above because our | 83 // Use RunnableType::RunType instead of RunType above because our |
| 81 // checks should below for bound references need to know what the actual | 84 // checks should below for bound references need to know what the actual |
| 82 // functor is going to interpret the argument as. | 85 // functor is going to interpret the argument as. |
| 83 typedef internal::FunctionTraits<typename RunnableType::RunType> | 86 typedef internal::FunctionTraits<typename RunnableType::RunType> |
| 84 BoundFunctorTraits; | 87 BoundFunctorTraits; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 96 // a scoped_refptr because BindState<> itself takes care of AddRef() for | 99 // a scoped_refptr because BindState<> itself takes care of AddRef() for |
| 97 // methods. We also disallow binding of an array as the method's target | 100 // methods. We also disallow binding of an array as the method's target |
| 98 // object. | 101 // object. |
| 99 COMPILE_ASSERT( | 102 COMPILE_ASSERT( |
| 100 internal::HasIsMethodTag<RunnableType>::value || | 103 internal::HasIsMethodTag<RunnableType>::value || |
| 101 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, | 104 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, |
| 102 p1_is_refcounted_type_and_needs_scoped_refptr); | 105 p1_is_refcounted_type_and_needs_scoped_refptr); |
| 103 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || | 106 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || |
| 104 !is_array<P1>::value, | 107 !is_array<P1>::value, |
| 105 first_bound_argument_to_method_cannot_be_array); | 108 first_bound_argument_to_method_cannot_be_array); |
| 109 typedef internal::BindState<RunnableType, RunType, |
| 110 void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState; |
| 106 | 111 |
| 107 return internal::MakeBindStateHolder( | 112 |
| 108 new internal::BindState<RunnableType, RunType, | 113 return Callback<typename BindState::UnboundRunType>( |
| 109 void(typename internal::CallbackParamTraits<P1>::StorageType)>( | 114 new BindState(internal::MakeRunnable(functor), p1)); |
| 110 internal::MakeRunnable(functor), p1)); | |
| 111 } | 115 } |
| 112 | 116 |
| 113 template <typename Functor, typename P1, typename P2> | 117 template <typename Functor, typename P1, typename P2> |
| 114 internal::BindStateHolder< | 118 base::Callback< |
| 115 internal::BindState< | 119 typename internal::BindState< |
| 116 typename internal::FunctorTraits<Functor>::RunnableType, | 120 typename internal::FunctorTraits<Functor>::RunnableType, |
| 117 typename internal::FunctorTraits<Functor>::RunType, | 121 typename internal::FunctorTraits<Functor>::RunType, |
| 118 void(typename internal::CallbackParamTraits<P1>::StorageType, | 122 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 119 typename internal::CallbackParamTraits<P2>::StorageType)> > | 123 typename internal::CallbackParamTraits<P2>::StorageType)> |
| 124 ::UnboundRunType> |
| 120 Bind(Functor functor, const P1& p1, const P2& p2) { | 125 Bind(Functor functor, const P1& p1, const P2& p2) { |
| 121 // Typedefs for how to store and run the functor. | 126 // Typedefs for how to store and run the functor. |
| 122 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 127 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
| 123 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 128 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
| 124 | 129 |
| 125 // Use RunnableType::RunType instead of RunType above because our | 130 // Use RunnableType::RunType instead of RunType above because our |
| 126 // checks should below for bound references need to know what the actual | 131 // checks should below for bound references need to know what the actual |
| 127 // functor is going to interpret the argument as. | 132 // functor is going to interpret the argument as. |
| 128 typedef internal::FunctionTraits<typename RunnableType::RunType> | 133 typedef internal::FunctionTraits<typename RunnableType::RunType> |
| 129 BoundFunctorTraits; | 134 BoundFunctorTraits; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 144 // object. | 149 // object. |
| 145 COMPILE_ASSERT( | 150 COMPILE_ASSERT( |
| 146 internal::HasIsMethodTag<RunnableType>::value || | 151 internal::HasIsMethodTag<RunnableType>::value || |
| 147 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, | 152 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, |
| 148 p1_is_refcounted_type_and_needs_scoped_refptr); | 153 p1_is_refcounted_type_and_needs_scoped_refptr); |
| 149 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || | 154 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || |
| 150 !is_array<P1>::value, | 155 !is_array<P1>::value, |
| 151 first_bound_argument_to_method_cannot_be_array); | 156 first_bound_argument_to_method_cannot_be_array); |
| 152 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 157 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
| 153 p2_is_refcounted_type_and_needs_scoped_refptr); | 158 p2_is_refcounted_type_and_needs_scoped_refptr); |
| 159 typedef internal::BindState<RunnableType, RunType, |
| 160 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 161 typename internal::CallbackParamTraits<P2>::StorageType)> BindState; |
| 154 | 162 |
| 155 return internal::MakeBindStateHolder( | 163 |
| 156 new internal::BindState<RunnableType, RunType, | 164 return Callback<typename BindState::UnboundRunType>( |
| 157 void(typename internal::CallbackParamTraits<P1>::StorageType, | 165 new BindState(internal::MakeRunnable(functor), p1, p2)); |
| 158 typename internal::CallbackParamTraits<P2>::StorageType)>( | |
| 159 internal::MakeRunnable(functor), p1, p2)); | |
| 160 } | 166 } |
| 161 | 167 |
| 162 template <typename Functor, typename P1, typename P2, typename P3> | 168 template <typename Functor, typename P1, typename P2, typename P3> |
| 163 internal::BindStateHolder< | 169 base::Callback< |
| 164 internal::BindState< | 170 typename internal::BindState< |
| 165 typename internal::FunctorTraits<Functor>::RunnableType, | 171 typename internal::FunctorTraits<Functor>::RunnableType, |
| 166 typename internal::FunctorTraits<Functor>::RunType, | 172 typename internal::FunctorTraits<Functor>::RunType, |
| 167 void(typename internal::CallbackParamTraits<P1>::StorageType, | 173 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 168 typename internal::CallbackParamTraits<P2>::StorageType, | 174 typename internal::CallbackParamTraits<P2>::StorageType, |
| 169 typename internal::CallbackParamTraits<P3>::StorageType)> > | 175 typename internal::CallbackParamTraits<P3>::StorageType)> |
| 176 ::UnboundRunType> |
| 170 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { | 177 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { |
| 171 // Typedefs for how to store and run the functor. | 178 // Typedefs for how to store and run the functor. |
| 172 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 179 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
| 173 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 180 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
| 174 | 181 |
| 175 // Use RunnableType::RunType instead of RunType above because our | 182 // Use RunnableType::RunType instead of RunType above because our |
| 176 // checks should below for bound references need to know what the actual | 183 // checks should below for bound references need to know what the actual |
| 177 // functor is going to interpret the argument as. | 184 // functor is going to interpret the argument as. |
| 178 typedef internal::FunctionTraits<typename RunnableType::RunType> | 185 typedef internal::FunctionTraits<typename RunnableType::RunType> |
| 179 BoundFunctorTraits; | 186 BoundFunctorTraits; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 197 internal::HasIsMethodTag<RunnableType>::value || | 204 internal::HasIsMethodTag<RunnableType>::value || |
| 198 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, | 205 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, |
| 199 p1_is_refcounted_type_and_needs_scoped_refptr); | 206 p1_is_refcounted_type_and_needs_scoped_refptr); |
| 200 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || | 207 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || |
| 201 !is_array<P1>::value, | 208 !is_array<P1>::value, |
| 202 first_bound_argument_to_method_cannot_be_array); | 209 first_bound_argument_to_method_cannot_be_array); |
| 203 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 210 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
| 204 p2_is_refcounted_type_and_needs_scoped_refptr); | 211 p2_is_refcounted_type_and_needs_scoped_refptr); |
| 205 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 212 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
| 206 p3_is_refcounted_type_and_needs_scoped_refptr); | 213 p3_is_refcounted_type_and_needs_scoped_refptr); |
| 214 typedef internal::BindState<RunnableType, RunType, |
| 215 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 216 typename internal::CallbackParamTraits<P2>::StorageType, |
| 217 typename internal::CallbackParamTraits<P3>::StorageType)> BindState; |
| 207 | 218 |
| 208 return internal::MakeBindStateHolder( | 219 |
| 209 new internal::BindState<RunnableType, RunType, | 220 return Callback<typename BindState::UnboundRunType>( |
| 210 void(typename internal::CallbackParamTraits<P1>::StorageType, | 221 new BindState(internal::MakeRunnable(functor), p1, p2, p3)); |
| 211 typename internal::CallbackParamTraits<P2>::StorageType, | |
| 212 typename internal::CallbackParamTraits<P3>::StorageType)>( | |
| 213 internal::MakeRunnable(functor), p1, p2, p3)); | |
| 214 } | 222 } |
| 215 | 223 |
| 216 template <typename Functor, typename P1, typename P2, typename P3, typename P4> | 224 template <typename Functor, typename P1, typename P2, typename P3, typename P4> |
| 217 internal::BindStateHolder< | 225 base::Callback< |
| 218 internal::BindState< | 226 typename internal::BindState< |
| 219 typename internal::FunctorTraits<Functor>::RunnableType, | 227 typename internal::FunctorTraits<Functor>::RunnableType, |
| 220 typename internal::FunctorTraits<Functor>::RunType, | 228 typename internal::FunctorTraits<Functor>::RunType, |
| 221 void(typename internal::CallbackParamTraits<P1>::StorageType, | 229 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 222 typename internal::CallbackParamTraits<P2>::StorageType, | 230 typename internal::CallbackParamTraits<P2>::StorageType, |
| 223 typename internal::CallbackParamTraits<P3>::StorageType, | 231 typename internal::CallbackParamTraits<P3>::StorageType, |
| 224 typename internal::CallbackParamTraits<P4>::StorageType)> > | 232 typename internal::CallbackParamTraits<P4>::StorageType)> |
| 233 ::UnboundRunType> |
| 225 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { | 234 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { |
| 226 // Typedefs for how to store and run the functor. | 235 // Typedefs for how to store and run the functor. |
| 227 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 236 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
| 228 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 237 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
| 229 | 238 |
| 230 // Use RunnableType::RunType instead of RunType above because our | 239 // Use RunnableType::RunType instead of RunType above because our |
| 231 // checks should below for bound references need to know what the actual | 240 // checks should below for bound references need to know what the actual |
| 232 // functor is going to interpret the argument as. | 241 // functor is going to interpret the argument as. |
| 233 typedef internal::FunctionTraits<typename RunnableType::RunType> | 242 typedef internal::FunctionTraits<typename RunnableType::RunType> |
| 234 BoundFunctorTraits; | 243 BoundFunctorTraits; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 255 p1_is_refcounted_type_and_needs_scoped_refptr); | 264 p1_is_refcounted_type_and_needs_scoped_refptr); |
| 256 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || | 265 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || |
| 257 !is_array<P1>::value, | 266 !is_array<P1>::value, |
| 258 first_bound_argument_to_method_cannot_be_array); | 267 first_bound_argument_to_method_cannot_be_array); |
| 259 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 268 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
| 260 p2_is_refcounted_type_and_needs_scoped_refptr); | 269 p2_is_refcounted_type_and_needs_scoped_refptr); |
| 261 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 270 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
| 262 p3_is_refcounted_type_and_needs_scoped_refptr); | 271 p3_is_refcounted_type_and_needs_scoped_refptr); |
| 263 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, | 272 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, |
| 264 p4_is_refcounted_type_and_needs_scoped_refptr); | 273 p4_is_refcounted_type_and_needs_scoped_refptr); |
| 274 typedef internal::BindState<RunnableType, RunType, |
| 275 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 276 typename internal::CallbackParamTraits<P2>::StorageType, |
| 277 typename internal::CallbackParamTraits<P3>::StorageType, |
| 278 typename internal::CallbackParamTraits<P4>::StorageType)> BindState; |
| 265 | 279 |
| 266 return internal::MakeBindStateHolder( | 280 |
| 267 new internal::BindState<RunnableType, RunType, | 281 return Callback<typename BindState::UnboundRunType>( |
| 268 void(typename internal::CallbackParamTraits<P1>::StorageType, | 282 new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4)); |
| 269 typename internal::CallbackParamTraits<P2>::StorageType, | |
| 270 typename internal::CallbackParamTraits<P3>::StorageType, | |
| 271 typename internal::CallbackParamTraits<P4>::StorageType)>( | |
| 272 internal::MakeRunnable(functor), p1, p2, p3, p4)); | |
| 273 } | 283 } |
| 274 | 284 |
| 275 template <typename Functor, typename P1, typename P2, typename P3, typename P4, | 285 template <typename Functor, typename P1, typename P2, typename P3, typename P4, |
| 276 typename P5> | 286 typename P5> |
| 277 internal::BindStateHolder< | 287 base::Callback< |
| 278 internal::BindState< | 288 typename internal::BindState< |
| 279 typename internal::FunctorTraits<Functor>::RunnableType, | 289 typename internal::FunctorTraits<Functor>::RunnableType, |
| 280 typename internal::FunctorTraits<Functor>::RunType, | 290 typename internal::FunctorTraits<Functor>::RunType, |
| 281 void(typename internal::CallbackParamTraits<P1>::StorageType, | 291 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 282 typename internal::CallbackParamTraits<P2>::StorageType, | 292 typename internal::CallbackParamTraits<P2>::StorageType, |
| 283 typename internal::CallbackParamTraits<P3>::StorageType, | 293 typename internal::CallbackParamTraits<P3>::StorageType, |
| 284 typename internal::CallbackParamTraits<P4>::StorageType, | 294 typename internal::CallbackParamTraits<P4>::StorageType, |
| 285 typename internal::CallbackParamTraits<P5>::StorageType)> > | 295 typename internal::CallbackParamTraits<P5>::StorageType)> |
| 296 ::UnboundRunType> |
| 286 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, | 297 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, |
| 287 const P5& p5) { | 298 const P5& p5) { |
| 288 // Typedefs for how to store and run the functor. | 299 // Typedefs for how to store and run the functor. |
| 289 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 300 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
| 290 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 301 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
| 291 | 302 |
| 292 // Use RunnableType::RunType instead of RunType above because our | 303 // Use RunnableType::RunType instead of RunType above because our |
| 293 // checks should below for bound references need to know what the actual | 304 // checks should below for bound references need to know what the actual |
| 294 // functor is going to interpret the argument as. | 305 // functor is going to interpret the argument as. |
| 295 typedef internal::FunctionTraits<typename RunnableType::RunType> | 306 typedef internal::FunctionTraits<typename RunnableType::RunType> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 320 !is_array<P1>::value, | 331 !is_array<P1>::value, |
| 321 first_bound_argument_to_method_cannot_be_array); | 332 first_bound_argument_to_method_cannot_be_array); |
| 322 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 333 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
| 323 p2_is_refcounted_type_and_needs_scoped_refptr); | 334 p2_is_refcounted_type_and_needs_scoped_refptr); |
| 324 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 335 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
| 325 p3_is_refcounted_type_and_needs_scoped_refptr); | 336 p3_is_refcounted_type_and_needs_scoped_refptr); |
| 326 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, | 337 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, |
| 327 p4_is_refcounted_type_and_needs_scoped_refptr); | 338 p4_is_refcounted_type_and_needs_scoped_refptr); |
| 328 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, | 339 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, |
| 329 p5_is_refcounted_type_and_needs_scoped_refptr); | 340 p5_is_refcounted_type_and_needs_scoped_refptr); |
| 341 typedef internal::BindState<RunnableType, RunType, |
| 342 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 343 typename internal::CallbackParamTraits<P2>::StorageType, |
| 344 typename internal::CallbackParamTraits<P3>::StorageType, |
| 345 typename internal::CallbackParamTraits<P4>::StorageType, |
| 346 typename internal::CallbackParamTraits<P5>::StorageType)> BindState; |
| 330 | 347 |
| 331 return internal::MakeBindStateHolder( | 348 |
| 332 new internal::BindState<RunnableType, RunType, | 349 return Callback<typename BindState::UnboundRunType>( |
| 333 void(typename internal::CallbackParamTraits<P1>::StorageType, | 350 new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5)); |
| 334 typename internal::CallbackParamTraits<P2>::StorageType, | |
| 335 typename internal::CallbackParamTraits<P3>::StorageType, | |
| 336 typename internal::CallbackParamTraits<P4>::StorageType, | |
| 337 typename internal::CallbackParamTraits<P5>::StorageType)>( | |
| 338 internal::MakeRunnable(functor), p1, p2, p3, p4, p5)); | |
| 339 } | 351 } |
| 340 | 352 |
| 341 template <typename Functor, typename P1, typename P2, typename P3, typename P4, | 353 template <typename Functor, typename P1, typename P2, typename P3, typename P4, |
| 342 typename P5, typename P6> | 354 typename P5, typename P6> |
| 343 internal::BindStateHolder< | 355 base::Callback< |
| 344 internal::BindState< | 356 typename internal::BindState< |
| 345 typename internal::FunctorTraits<Functor>::RunnableType, | 357 typename internal::FunctorTraits<Functor>::RunnableType, |
| 346 typename internal::FunctorTraits<Functor>::RunType, | 358 typename internal::FunctorTraits<Functor>::RunType, |
| 347 void(typename internal::CallbackParamTraits<P1>::StorageType, | 359 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 348 typename internal::CallbackParamTraits<P2>::StorageType, | 360 typename internal::CallbackParamTraits<P2>::StorageType, |
| 349 typename internal::CallbackParamTraits<P3>::StorageType, | 361 typename internal::CallbackParamTraits<P3>::StorageType, |
| 350 typename internal::CallbackParamTraits<P4>::StorageType, | 362 typename internal::CallbackParamTraits<P4>::StorageType, |
| 351 typename internal::CallbackParamTraits<P5>::StorageType, | 363 typename internal::CallbackParamTraits<P5>::StorageType, |
| 352 typename internal::CallbackParamTraits<P6>::StorageType)> > | 364 typename internal::CallbackParamTraits<P6>::StorageType)> |
| 365 ::UnboundRunType> |
| 353 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, | 366 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, |
| 354 const P5& p5, const P6& p6) { | 367 const P5& p5, const P6& p6) { |
| 355 // Typedefs for how to store and run the functor. | 368 // Typedefs for how to store and run the functor. |
| 356 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 369 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
| 357 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 370 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
| 358 | 371 |
| 359 // Use RunnableType::RunType instead of RunType above because our | 372 // Use RunnableType::RunType instead of RunType above because our |
| 360 // checks should below for bound references need to know what the actual | 373 // checks should below for bound references need to know what the actual |
| 361 // functor is going to interpret the argument as. | 374 // functor is going to interpret the argument as. |
| 362 typedef internal::FunctionTraits<typename RunnableType::RunType> | 375 typedef internal::FunctionTraits<typename RunnableType::RunType> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 390 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 403 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
| 391 p2_is_refcounted_type_and_needs_scoped_refptr); | 404 p2_is_refcounted_type_and_needs_scoped_refptr); |
| 392 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 405 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
| 393 p3_is_refcounted_type_and_needs_scoped_refptr); | 406 p3_is_refcounted_type_and_needs_scoped_refptr); |
| 394 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, | 407 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, |
| 395 p4_is_refcounted_type_and_needs_scoped_refptr); | 408 p4_is_refcounted_type_and_needs_scoped_refptr); |
| 396 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, | 409 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, |
| 397 p5_is_refcounted_type_and_needs_scoped_refptr); | 410 p5_is_refcounted_type_and_needs_scoped_refptr); |
| 398 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, | 411 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, |
| 399 p6_is_refcounted_type_and_needs_scoped_refptr); | 412 p6_is_refcounted_type_and_needs_scoped_refptr); |
| 413 typedef internal::BindState<RunnableType, RunType, |
| 414 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 415 typename internal::CallbackParamTraits<P2>::StorageType, |
| 416 typename internal::CallbackParamTraits<P3>::StorageType, |
| 417 typename internal::CallbackParamTraits<P4>::StorageType, |
| 418 typename internal::CallbackParamTraits<P5>::StorageType, |
| 419 typename internal::CallbackParamTraits<P6>::StorageType)> BindState; |
| 400 | 420 |
| 401 return internal::MakeBindStateHolder( | 421 |
| 402 new internal::BindState<RunnableType, RunType, | 422 return Callback<typename BindState::UnboundRunType>( |
| 403 void(typename internal::CallbackParamTraits<P1>::StorageType, | 423 new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); |
| 404 typename internal::CallbackParamTraits<P2>::StorageType, | |
| 405 typename internal::CallbackParamTraits<P3>::StorageType, | |
| 406 typename internal::CallbackParamTraits<P4>::StorageType, | |
| 407 typename internal::CallbackParamTraits<P5>::StorageType, | |
| 408 typename internal::CallbackParamTraits<P6>::StorageType)>( | |
| 409 internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); | |
| 410 } | 424 } |
| 411 | 425 |
| 412 template <typename Functor, typename P1, typename P2, typename P3, typename P4, | 426 template <typename Functor, typename P1, typename P2, typename P3, typename P4, |
| 413 typename P5, typename P6, typename P7> | 427 typename P5, typename P6, typename P7> |
| 414 internal::BindStateHolder< | 428 base::Callback< |
| 415 internal::BindState< | 429 typename internal::BindState< |
| 416 typename internal::FunctorTraits<Functor>::RunnableType, | 430 typename internal::FunctorTraits<Functor>::RunnableType, |
| 417 typename internal::FunctorTraits<Functor>::RunType, | 431 typename internal::FunctorTraits<Functor>::RunType, |
| 418 void(typename internal::CallbackParamTraits<P1>::StorageType, | 432 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 419 typename internal::CallbackParamTraits<P2>::StorageType, | 433 typename internal::CallbackParamTraits<P2>::StorageType, |
| 420 typename internal::CallbackParamTraits<P3>::StorageType, | 434 typename internal::CallbackParamTraits<P3>::StorageType, |
| 421 typename internal::CallbackParamTraits<P4>::StorageType, | 435 typename internal::CallbackParamTraits<P4>::StorageType, |
| 422 typename internal::CallbackParamTraits<P5>::StorageType, | 436 typename internal::CallbackParamTraits<P5>::StorageType, |
| 423 typename internal::CallbackParamTraits<P6>::StorageType, | 437 typename internal::CallbackParamTraits<P6>::StorageType, |
| 424 typename internal::CallbackParamTraits<P7>::StorageType)> > | 438 typename internal::CallbackParamTraits<P7>::StorageType)> |
| 439 ::UnboundRunType> |
| 425 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, | 440 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, |
| 426 const P5& p5, const P6& p6, const P7& p7) { | 441 const P5& p5, const P6& p6, const P7& p7) { |
| 427 // Typedefs for how to store and run the functor. | 442 // Typedefs for how to store and run the functor. |
| 428 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 443 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
| 429 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 444 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
| 430 | 445 |
| 431 // Use RunnableType::RunType instead of RunType above because our | 446 // Use RunnableType::RunType instead of RunType above because our |
| 432 // checks should below for bound references need to know what the actual | 447 // checks should below for bound references need to know what the actual |
| 433 // functor is going to interpret the argument as. | 448 // functor is going to interpret the argument as. |
| 434 typedef internal::FunctionTraits<typename RunnableType::RunType> | 449 typedef internal::FunctionTraits<typename RunnableType::RunType> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 465 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 480 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
| 466 p3_is_refcounted_type_and_needs_scoped_refptr); | 481 p3_is_refcounted_type_and_needs_scoped_refptr); |
| 467 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, | 482 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, |
| 468 p4_is_refcounted_type_and_needs_scoped_refptr); | 483 p4_is_refcounted_type_and_needs_scoped_refptr); |
| 469 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, | 484 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, |
| 470 p5_is_refcounted_type_and_needs_scoped_refptr); | 485 p5_is_refcounted_type_and_needs_scoped_refptr); |
| 471 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, | 486 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, |
| 472 p6_is_refcounted_type_and_needs_scoped_refptr); | 487 p6_is_refcounted_type_and_needs_scoped_refptr); |
| 473 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, | 488 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, |
| 474 p7_is_refcounted_type_and_needs_scoped_refptr); | 489 p7_is_refcounted_type_and_needs_scoped_refptr); |
| 490 typedef internal::BindState<RunnableType, RunType, |
| 491 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 492 typename internal::CallbackParamTraits<P2>::StorageType, |
| 493 typename internal::CallbackParamTraits<P3>::StorageType, |
| 494 typename internal::CallbackParamTraits<P4>::StorageType, |
| 495 typename internal::CallbackParamTraits<P5>::StorageType, |
| 496 typename internal::CallbackParamTraits<P6>::StorageType, |
| 497 typename internal::CallbackParamTraits<P7>::StorageType)> BindState; |
| 475 | 498 |
| 476 return internal::MakeBindStateHolder( | 499 |
| 477 new internal::BindState<RunnableType, RunType, | 500 return Callback<typename BindState::UnboundRunType>( |
| 478 void(typename internal::CallbackParamTraits<P1>::StorageType, | 501 new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, |
| 479 typename internal::CallbackParamTraits<P2>::StorageType, | 502 p7)); |
| 480 typename internal::CallbackParamTraits<P3>::StorageType, | |
| 481 typename internal::CallbackParamTraits<P4>::StorageType, | |
| 482 typename internal::CallbackParamTraits<P5>::StorageType, | |
| 483 typename internal::CallbackParamTraits<P6>::StorageType, | |
| 484 typename internal::CallbackParamTraits<P7>::StorageType)>( | |
| 485 internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7)); | |
| 486 } | 503 } |
| 487 | 504 |
| 488 } // namespace base | 505 } // namespace base |
| 489 | 506 |
| 490 #endif // BASE_BIND_H_ | 507 #endif // BASE_BIND_H_ |
| OLD | NEW |