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

Side by Side Diff: third_party/WebKit/Source/platform/heap/PersistentNode.cpp

Issue 2007283002: Allow CrossThreadPersistent in collections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Persistent.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "platform/heap/PersistentNode.h" 5 #include "platform/heap/PersistentNode.h"
6 6
7 #include "platform/heap/Handle.h" 7 #include "platform/heap/Handle.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 prevNext = &slots->m_next; 117 prevNext = &slots->m_next;
118 slots = slots->m_next; 118 slots = slots->m_next;
119 } 119 }
120 } 120 }
121 ASSERT(persistentCount == m_persistentCount); 121 ASSERT(persistentCount == m_persistentCount);
122 } 122 }
123 123
124 bool CrossThreadPersistentRegion::shouldTracePersistentNode(Visitor* visitor, Pe rsistentNode* node) 124 bool CrossThreadPersistentRegion::shouldTracePersistentNode(Visitor* visitor, Pe rsistentNode* node)
125 { 125 {
126 CrossThreadPersistent<DummyGCBase>* persistent = reinterpret_cast<CrossThrea dPersistent<DummyGCBase>*>(node->self()); 126 CrossThreadPersistent<DummyGCBase>* persistent = reinterpret_cast<CrossThrea dPersistent<DummyGCBase>*>(node->self());
127 ASSERT(persistent); 127 DCHECK(persistent);
128 DCHECK(!persistent->isHashTableDeletedValue());
128 Address rawObject = reinterpret_cast<Address>(persistent->get()); 129 Address rawObject = reinterpret_cast<Address>(persistent->get());
129 if (!rawObject) 130 if (!rawObject)
130 return false; 131 return false;
131 return &visitor->heap() == &ThreadState::fromObject(rawObject)->heap(); 132 return &visitor->heap() == &ThreadState::fromObject(rawObject)->heap();
132 } 133 }
133 134
134 void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState* threadState) 135 void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState* threadState)
135 { 136 {
136 // For heaps belonging to a thread that's detaching, any cross-thread persis tents 137 // For heaps belonging to a thread that's detaching, any cross-thread persis tents
137 // pointing into them needs to be disabled. Do that by clearing out the unde rlying 138 // pointing into them needs to be disabled. Do that by clearing out the unde rlying
(...skipping 24 matching lines...) Expand all
162 if (page->arena()->getThreadState() == threadState) { 163 if (page->arena()->getThreadState() == threadState) {
163 persistent->clear(); 164 persistent->clear();
164 ASSERT(slots->m_slot[i].isUnused()); 165 ASSERT(slots->m_slot[i].isUnused());
165 } 166 }
166 } 167 }
167 slots = slots->m_next; 168 slots = slots->m_next;
168 } 169 }
169 } 170 }
170 171
171 } // namespace blink 172 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Persistent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698