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/Member.h" | 8 #include "platform/heap/Member.h" |
9 #include "platform/heap/PersistentNode.h" | 9 #include "platform/heap/PersistentNode.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 { | 150 { |
151 if (m_persistentNode) { | 151 if (m_persistentNode) { |
152 ASSERT(ThreadState::current()); | 152 ASSERT(ThreadState::current()); |
153 ThreadState::current()->registerStaticPersistentNode(m_persistentNod
e, nullptr); | 153 ThreadState::current()->registerStaticPersistentNode(m_persistentNod
e, nullptr); |
154 LEAK_SANITIZER_IGNORE_OBJECT(this); | 154 LEAK_SANITIZER_IGNORE_OBJECT(this); |
155 } | 155 } |
156 return this; | 156 return this; |
157 } | 157 } |
158 | 158 |
159 protected: | 159 protected: |
| 160 NO_SANITIZE_ADDRESS |
160 T* atomicGet() { return reinterpret_cast<T*>(acquireLoad(reinterpret_cast<vo
id* volatile*>(&m_raw))); } | 161 T* atomicGet() { return reinterpret_cast<T*>(acquireLoad(reinterpret_cast<vo
id* volatile*>(&m_raw))); } |
161 | 162 |
162 private: | 163 private: |
163 NO_LAZY_SWEEP_SANITIZE_ADDRESS | 164 NO_LAZY_SWEEP_SANITIZE_ADDRESS |
164 void assign(T* ptr) | 165 void assign(T* ptr) |
165 { | 166 { |
166 if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) | 167 if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) |
167 releaseStore(reinterpret_cast<void* volatile*>(&m_raw), ptr); | 168 releaseStore(reinterpret_cast<void* volatile*>(&m_raw), ptr); |
168 else | 169 else |
169 m_raw = ptr; | 170 m_raw = ptr; |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 // into it. | 745 // into it. |
745 // | 746 // |
746 // TODO(sof): remove this hack once wtf/Functional.h can also work with a ty
pe like | 747 // TODO(sof): remove this hack once wtf/Functional.h can also work with a ty
pe like |
747 // CrossThreadWeakPersistent<>. | 748 // CrossThreadWeakPersistent<>. |
748 static WeakPtr<T> unwrap(const StorageType& value) { return WeakPtr<T>(WeakR
eference<T>::create(value.get())); } | 749 static WeakPtr<T> unwrap(const StorageType& value) { return WeakPtr<T>(WeakR
eference<T>::create(value.get())); } |
749 }; | 750 }; |
750 | 751 |
751 } // namespace WTF | 752 } // namespace WTF |
752 | 753 |
753 #endif // Persistent_h | 754 #endif // Persistent_h |
OLD | NEW |