| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 { | 233 { |
| 234 } | 234 } |
| 235 | 235 |
| 236 void NEVER_INLINE checkThread() | 236 void NEVER_INLINE checkThread() |
| 237 { | 237 { |
| 238 // Function with SameThreadAffinity, including SameThreadClosure | 238 // Function with SameThreadAffinity, including SameThreadClosure |
| 239 // created by WTF::bind() or blink::createSameThreadTask(), | 239 // created by WTF::bind() or blink::createSameThreadTask(), |
| 240 // must be called and destructed on the thread where it is created. | 240 // must be called and destructed on the thread where it is created. |
| 241 // If it is intended to be used cross-thread, use | 241 // If it is intended to be used cross-thread, use |
| 242 // blink::threadSafeBind() or blink::createCrossThreadTask() instead. | 242 // blink::threadSafeBind() or blink::createCrossThreadTask() instead. |
| 243 CHECK_EQ(m_createdThread, currentThread()); | 243 RELEASE_ASSERT(m_createdThread == currentThread()); |
| 244 } | 244 } |
| 245 | 245 |
| 246 private: | 246 private: |
| 247 const ThreadIdentifier m_createdThread; | 247 const ThreadIdentifier m_createdThread; |
| 248 }; | 248 }; |
| 249 #endif | 249 #endif |
| 250 | 250 |
| 251 template <FunctionThreadAffinity threadAffinity, typename BoundParametersTuple,
typename FunctionWrapper, typename... UnboundParameters> | 251 template <FunctionThreadAffinity threadAffinity, typename BoundParametersTuple,
typename FunctionWrapper, typename... UnboundParameters> |
| 252 class PartBoundFunctionImpl; | 252 class PartBoundFunctionImpl; |
| 253 | 253 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 typedef Function<void(), CrossThreadAffinity> CrossThreadClosure; | 309 typedef Function<void(), CrossThreadAffinity> CrossThreadClosure; |
| 310 | 310 |
| 311 } // namespace WTF | 311 } // namespace WTF |
| 312 | 312 |
| 313 using WTF::Function; | 313 using WTF::Function; |
| 314 using WTF::bind; | 314 using WTF::bind; |
| 315 using WTF::SameThreadClosure; | 315 using WTF::SameThreadClosure; |
| 316 using WTF::CrossThreadClosure; | 316 using WTF::CrossThreadClosure; |
| 317 | 317 |
| 318 #endif // WTF_Functional_h | 318 #endif // WTF_Functional_h |
| OLD | NEW |