Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Side by Side Diff: third_party/WebKit/Source/platform/heap/Persistent.h

Issue 2694173002: Remove thread-local weak processing (Closed)
Patch Set: temp Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 uninitialize(); 190 uninitialize();
191 } 191 }
192 192
193 template <typename VisitorDispatcher> 193 template <typename VisitorDispatcher>
194 void tracePersistent(VisitorDispatcher visitor) { 194 void tracePersistent(VisitorDispatcher visitor) {
195 static_assert(sizeof(T), "T must be fully defined"); 195 static_assert(sizeof(T), "T must be fully defined");
196 static_assert(IsGarbageCollectedType<T>::value, 196 static_assert(IsGarbageCollectedType<T>::value,
197 "T needs to be a garbage collected object"); 197 "T needs to be a garbage collected object");
198 if (weaknessConfiguration == WeakPersistentConfiguration) { 198 if (weaknessConfiguration == WeakPersistentConfiguration) {
199 if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) 199 visitor->registerWeakCallback(this, handleWeakPersistent);
200 visitor->registerWeakCellWithCallback(reinterpret_cast<void**>(this),
201 handleWeakPersistent);
202 else
203 visitor->registerWeakMembers(this, m_raw, handleWeakPersistent);
204 } else { 200 } else {
205 visitor->mark(m_raw); 201 visitor->mark(m_raw);
206 } 202 }
207 } 203 }
208 204
209 NO_SANITIZE_ADDRESS 205 NO_SANITIZE_ADDRESS
210 void initialize() { 206 void initialize() {
211 ASSERT(!m_persistentNode); 207 ASSERT(!m_persistentNode);
212 if (!m_raw || isHashTableDeletedValue()) 208 if (!m_raw || isHashTableDeletedValue())
213 return; 209 return;
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 static blink::CrossThreadPersistent<T> Unwrap( 805 static blink::CrossThreadPersistent<T> Unwrap(
810 const blink::CrossThreadWeakPersistent<T>& wrapped) { 806 const blink::CrossThreadWeakPersistent<T>& wrapped) {
811 blink::CrossThreadPersistentRegion::LockScope persistentLock( 807 blink::CrossThreadPersistentRegion::LockScope persistentLock(
812 blink::ProcessHeap::crossThreadPersistentRegion()); 808 blink::ProcessHeap::crossThreadPersistentRegion());
813 return blink::CrossThreadPersistent<T>(wrapped.get()); 809 return blink::CrossThreadPersistent<T>(wrapped.get());
814 } 810 }
815 }; 811 };
816 } 812 }
817 813
818 #endif // Persistent_h 814 #endif // Persistent_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapAllocator.h ('k') | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698