| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_BIND_INTERNAL_H_ | 5 #ifndef BASE_BIND_INTERNAL_H_ |
| 6 #define BASE_BIND_INTERNAL_H_ | 6 #define BASE_BIND_INTERNAL_H_ |
| 7 | 7 |
| 8 #include <type_traits> | 8 #include <type_traits> |
| 9 | 9 |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 } | 306 } |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 #if !defined(_MSC_VER) | 309 #if !defined(_MSC_VER) |
| 310 | 310 |
| 311 template <typename ReturnType, typename Runnable, typename ArgsType> | 311 template <typename ReturnType, typename Runnable, typename ArgsType> |
| 312 struct InvokeHelper<true, ReturnType, Runnable, ArgsType> { | 312 struct InvokeHelper<true, ReturnType, Runnable, ArgsType> { |
| 313 // WeakCalls are only supported for functions with a void return type. | 313 // WeakCalls are only supported for functions with a void return type. |
| 314 // Otherwise, the function result would be undefined if the the WeakPtr<> | 314 // Otherwise, the function result would be undefined if the the WeakPtr<> |
| 315 // is invalidated. | 315 // is invalidated. |
| 316 COMPILE_ASSERT(is_void<ReturnType>::value, | 316 static_assert(is_void<ReturnType>::value, |
| 317 weak_ptrs_can_only_bind_to_methods_without_return_values); | 317 "weak_ptrs_can_only_bind_to_methods_without_return_values"); |
| 318 }; | 318 }; |
| 319 | 319 |
| 320 #endif | 320 #endif |
| 321 | 321 |
| 322 // Invoker<> | 322 // Invoker<> |
| 323 // | 323 // |
| 324 // See description at the top of the file. | 324 // See description at the top of the file. |
| 325 template <typename BoundIndices, | 325 template <typename BoundIndices, |
| 326 typename StorageType, typename Unwrappers, | 326 typename StorageType, typename Unwrappers, |
| 327 typename InvokeHelperType, typename UnboundForwardRunType> | 327 typename InvokeHelperType, typename UnboundForwardRunType> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 static void Destroy(BindStateBase* self) { | 416 static void Destroy(BindStateBase* self) { |
| 417 delete static_cast<BindState*>(self); | 417 delete static_cast<BindState*>(self); |
| 418 } | 418 } |
| 419 }; | 419 }; |
| 420 | 420 |
| 421 } // namespace internal | 421 } // namespace internal |
| 422 } // namespace base | 422 } // namespace base |
| 423 | 423 |
| 424 #endif // BASE_BIND_INTERNAL_H_ | 424 #endif // BASE_BIND_INTERNAL_H_ |
| OLD | NEW |