| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 { | 1189 { |
| 1190 return p.get(); | 1190 return p.get(); |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 // For wtf/Functional.h | 1193 // For wtf/Functional.h |
| 1194 template<typename T, bool isGarbageCollected> struct PointerParamStorageTraits; | 1194 template<typename T, bool isGarbageCollected> struct PointerParamStorageTraits; |
| 1195 | 1195 |
| 1196 // The condition of 'T must be fully defined' (except for void) is checked in | 1196 // The condition of 'T must be fully defined' (except for void) is checked in |
| 1197 // blink::IsGarbageCollectedType<T>::value. | 1197 // blink::IsGarbageCollectedType<T>::value. |
| 1198 template<typename T> | 1198 template<typename T> |
| 1199 struct PointerParamStorageTraits<T*, false> { | |
| 1200 STATIC_ONLY(PointerParamStorageTraits); | |
| 1201 using StorageType = T*; | |
| 1202 | |
| 1203 static StorageType wrap(T* value) { return value; } | |
| 1204 static T* unwrap(const StorageType& value) { return value; } | |
| 1205 }; | |
| 1206 | |
| 1207 template<typename T> | |
| 1208 struct PointerParamStorageTraits<T*, true> { | 1199 struct PointerParamStorageTraits<T*, true> { |
| 1209 STATIC_ONLY(PointerParamStorageTraits); | 1200 STATIC_ONLY(PointerParamStorageTraits); |
| 1210 using StorageType = blink::CrossThreadPersistent<T>; | 1201 using StorageType = blink::CrossThreadPersistent<T>; |
| 1211 | 1202 |
| 1212 static StorageType wrap(T* value) { return value; } | 1203 static StorageType wrap(T* value) { return value; } |
| 1213 static T* unwrap(const StorageType& value) { return value.get(); } | 1204 static T* unwrap(const StorageType& value) { return value.get(); } |
| 1214 }; | 1205 }; |
| 1215 | 1206 |
| 1216 template<typename T> | 1207 template<typename T> |
| 1217 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa
rbageCollectedType<T>::value> { | 1208 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa
rbageCollectedType<T>::value> { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 STATIC_ONLY(ParamStorageTraits); | 1255 STATIC_ONLY(ParamStorageTraits); |
| 1265 | 1256 |
| 1266 using StorageType = blink::CrossThreadRetainedRefWrapper<T>; | 1257 using StorageType = blink::CrossThreadRetainedRefWrapper<T>; |
| 1267 static StorageType wrap(blink::CrossThreadRetainedRefWrapper<T>&& value) { r
eturn std::move(value); } | 1258 static StorageType wrap(blink::CrossThreadRetainedRefWrapper<T>&& value) { r
eturn std::move(value); } |
| 1268 static T* unwrap(const StorageType& value) { return value.value(); } | 1259 static T* unwrap(const StorageType& value) { return value.value(); } |
| 1269 }; | 1260 }; |
| 1270 | 1261 |
| 1271 } // namespace WTF | 1262 } // namespace WTF |
| 1272 | 1263 |
| 1273 #endif | 1264 #endif |
| OLD | NEW |