| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 template <typename> class RetainPtr; | 207 template <typename> class RetainPtr; |
| 208 | 208 |
| 209 template <typename T> | 209 template <typename T> |
| 210 struct ParamStorageTraits<RetainPtr<T>> { | 210 struct ParamStorageTraits<RetainPtr<T>> { |
| 211 typedef RetainPtr<T> StorageType; | 211 typedef RetainPtr<T> StorageType; |
| 212 | 212 |
| 213 static StorageType wrap(const RetainPtr<T>& value) { return value; } | 213 static StorageType wrap(const RetainPtr<T>& value) { return value; } |
| 214 static typename RetainPtr<T>::PtrType unwrap(const StorageType& value) { ret
urn value.get(); } | 214 static typename RetainPtr<T>::PtrType unwrap(const StorageType& value) { ret
urn value.get(); } |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 template <> | |
| 218 struct ParamStorageTraits<void*> { | |
| 219 typedef void* StorageType; | |
| 220 | |
| 221 static StorageType wrap(void* value) { return value; } | |
| 222 static void* unwrap(const StorageType& value) { return value; } | |
| 223 }; | |
| 224 | |
| 225 template <typename T> | 217 template <typename T> |
| 226 struct ParamStorageTraits<PassedWrapper<T>> { | 218 struct ParamStorageTraits<PassedWrapper<T>> { |
| 227 typedef PassedWrapper<T> StorageType; | 219 typedef PassedWrapper<T> StorageType; |
| 228 | 220 |
| 229 static StorageType wrap(PassedWrapper<T>&& value) { return std::move(value);
} | 221 static StorageType wrap(PassedWrapper<T>&& value) { return std::move(value);
} |
| 230 static T unwrap(StorageType& value) { return value.moveOut(); } | 222 static T unwrap(StorageType& value) { return value.moveOut(); } |
| 231 }; | 223 }; |
| 232 | 224 |
| 233 enum FunctionThreadAffinity { | 225 enum FunctionThreadAffinity { |
| 234 CrossThreadAffinity, | 226 CrossThreadAffinity, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 336 |
| 345 } // namespace WTF | 337 } // namespace WTF |
| 346 | 338 |
| 347 using WTF::passed; | 339 using WTF::passed; |
| 348 using WTF::Function; | 340 using WTF::Function; |
| 349 using WTF::bind; | 341 using WTF::bind; |
| 350 using WTF::SameThreadClosure; | 342 using WTF::SameThreadClosure; |
| 351 using WTF::CrossThreadClosure; | 343 using WTF::CrossThreadClosure; |
| 352 | 344 |
| 353 #endif // WTF_Functional_h | 345 #endif // WTF_Functional_h |
| OLD | NEW |