OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef Persistent_h | 5 #ifndef Persistent_h |
6 #define Persistent_h | 6 #define Persistent_h |
7 | 7 |
8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
9 #include "platform/heap/Member.h" | 9 #include "platform/heap/Member.h" |
10 #include "platform/heap/PersistentNode.h" | 10 #include "platform/heap/PersistentNode.h" |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 } // namespace WTF | 759 } // namespace WTF |
760 | 760 |
761 namespace base { | 761 namespace base { |
762 | 762 |
763 template <typename T> | 763 template <typename T> |
764 struct IsWeakReceiver<blink::WeakPersistent<T>> : std::true_type {}; | 764 struct IsWeakReceiver<blink::WeakPersistent<T>> : std::true_type {}; |
765 | 765 |
766 template <typename T> | 766 template <typename T> |
767 struct IsWeakReceiver<blink::CrossThreadWeakPersistent<T>> : std::true_type {}; | 767 struct IsWeakReceiver<blink::CrossThreadWeakPersistent<T>> : std::true_type {}; |
768 | 768 |
| 769 template <typename T> |
| 770 struct BindUnwrapTraits<blink::CrossThreadWeakPersistent<T>> { |
| 771 static blink::CrossThreadPersistent<T> Unwrap(const blink::CrossThreadWeakPe
rsistent<T>& wrapped) |
| 772 { |
| 773 blink::CrossThreadPersistentRegion::LockScope persistentLock(blink::Proc
essHeap::crossThreadPersistentRegion()); |
| 774 return blink::CrossThreadPersistent<T>(wrapped.get()); |
| 775 } |
| 776 }; |
| 777 |
769 } | 778 } |
770 | 779 |
771 #endif // Persistent_h | 780 #endif // Persistent_h |
OLD | NEW |