| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 * THE POSSIBILITY OF SUCH DAMAGE. | 23 * THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef WTF_Functional_h | 26 #ifndef WTF_Functional_h |
| 27 #define WTF_Functional_h | 27 #define WTF_Functional_h |
| 28 | 28 |
| 29 #include "base/tuple.h" | 29 #include "base/tuple.h" |
| 30 #include "wtf/Allocator.h" | 30 #include "wtf/Allocator.h" |
| 31 #include "wtf/Assertions.h" | 31 #include "wtf/Assertions.h" |
| 32 #include "wtf/PassOwnPtr.h" | |
| 33 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
| 34 #include "wtf/PtrUtil.h" | 33 #include "wtf/PtrUtil.h" |
| 35 #include "wtf/RefPtr.h" | 34 #include "wtf/RefPtr.h" |
| 36 #include "wtf/ThreadSafeRefCounted.h" | 35 #include "wtf/ThreadSafeRefCounted.h" |
| 37 #include "wtf/TypeTraits.h" | 36 #include "wtf/TypeTraits.h" |
| 38 #include "wtf/WeakPtr.h" | 37 #include "wtf/WeakPtr.h" |
| 39 #include <tuple> | 38 #include <tuple> |
| 40 #include <utility> | 39 #include <utility> |
| 41 | 40 |
| 42 namespace blink { | 41 namespace blink { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 { | 160 { |
| 162 } | 161 } |
| 163 | 162 |
| 164 template <typename... IncomingParameters> | 163 template <typename... IncomingParameters> |
| 165 R operator()(C* c, IncomingParameters&&... parameters) | 164 R operator()(C* c, IncomingParameters&&... parameters) |
| 166 { | 165 { |
| 167 return (c->*m_function)(std::forward<IncomingParameters>(parameters)...)
; | 166 return (c->*m_function)(std::forward<IncomingParameters>(parameters)...)
; |
| 168 } | 167 } |
| 169 | 168 |
| 170 template <typename... IncomingParameters> | 169 template <typename... IncomingParameters> |
| 171 R operator()(const PassOwnPtr<C>& c, IncomingParameters&&... parameters) | |
| 172 { | |
| 173 return (c.get()->*m_function)(std::forward<IncomingParameters>(parameter
s)...); | |
| 174 } | |
| 175 | |
| 176 template <typename... IncomingParameters> | |
| 177 R operator()(const std::unique_ptr<C>& c, IncomingParameters&&... parameters
) | 170 R operator()(const std::unique_ptr<C>& c, IncomingParameters&&... parameters
) |
| 178 { | 171 { |
| 179 return (c.get()->*m_function)(std::forward<IncomingParameters>(parameter
s)...); | 172 return (c.get()->*m_function)(std::forward<IncomingParameters>(parameter
s)...); |
| 180 } | 173 } |
| 181 | 174 |
| 182 template <typename... IncomingParameters> | 175 template <typename... IncomingParameters> |
| 183 R operator()(const WeakPtr<C>& c, IncomingParameters&&... parameters) | 176 R operator()(const WeakPtr<C>& c, IncomingParameters&&... parameters) |
| 184 { | 177 { |
| 185 C* obj = c.get(); | 178 C* obj = c.get(); |
| 186 if (!obj) | 179 if (!obj) |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 369 |
| 377 } // namespace WTF | 370 } // namespace WTF |
| 378 | 371 |
| 379 using WTF::passed; | 372 using WTF::passed; |
| 380 using WTF::Function; | 373 using WTF::Function; |
| 381 using WTF::bind; | 374 using WTF::bind; |
| 382 using WTF::SameThreadClosure; | 375 using WTF::SameThreadClosure; |
| 383 using WTF::CrossThreadClosure; | 376 using WTF::CrossThreadClosure; |
| 384 | 377 |
| 385 #endif // WTF_Functional_h | 378 #endif // WTF_Functional_h |
| OLD | NEW |