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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 { | 152 { |
153 } | 153 } |
154 | 154 |
155 template <typename... IncomingParameters> | 155 template <typename... IncomingParameters> |
156 R operator()(C* c, IncomingParameters&&... parameters) | 156 R operator()(C* c, IncomingParameters&&... parameters) |
157 { | 157 { |
158 return (c->*m_function)(std::forward<IncomingParameters>(parameters)...)
; | 158 return (c->*m_function)(std::forward<IncomingParameters>(parameters)...)
; |
159 } | 159 } |
160 | 160 |
161 template <typename... IncomingParameters> | 161 template <typename... IncomingParameters> |
162 R operator()(PassOwnPtr<C> c, IncomingParameters&&... parameters) | 162 R operator()(const PassOwnPtr<C>& c, IncomingParameters&&... parameters) |
163 { | 163 { |
164 return (c.get()->*m_function)(std::forward<IncomingParameters>(parameter
s)...); | 164 return (c.get()->*m_function)(std::forward<IncomingParameters>(parameter
s)...); |
165 } | 165 } |
166 | 166 |
167 template <typename... IncomingParameters> | 167 template <typename... IncomingParameters> |
168 R operator()(const WeakPtr<C>& c, IncomingParameters&&... parameters) | 168 R operator()(const WeakPtr<C>& c, IncomingParameters&&... parameters) |
169 { | 169 { |
170 C* obj = c.get(); | 170 C* obj = c.get(); |
171 if (!obj) | 171 if (!obj) |
172 return R(); | 172 return R(); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 } // namespace WTF | 345 } // namespace WTF |
346 | 346 |
347 using WTF::passed; | 347 using WTF::passed; |
348 using WTF::Function; | 348 using WTF::Function; |
349 using WTF::bind; | 349 using WTF::bind; |
350 using WTF::SameThreadClosure; | 350 using WTF::SameThreadClosure; |
351 using WTF::CrossThreadClosure; | 351 using WTF::CrossThreadClosure; |
352 | 352 |
353 #endif // WTF_Functional_h | 353 #endif // WTF_Functional_h |
OLD | NEW |