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

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

Issue 2028433003: Revert of 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 DCHECK(persistent); 127 ASSERT(persistent);
128 DCHECK(!persistent->isHashTableDeletedValue());
129 Address rawObject = reinterpret_cast<Address>(persistent->get()); 128 Address rawObject = reinterpret_cast<Address>(persistent->get());
130 if (!rawObject) 129 if (!rawObject)
131 return false; 130 return false;
132 return &visitor->heap() == &ThreadState::fromObject(rawObject)->heap(); 131 return &visitor->heap() == &ThreadState::fromObject(rawObject)->heap();
133 } 132 }
134 133
135 void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState* threadState) 134 void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState* threadState)
136 { 135 {
137 // For heaps belonging to a thread that's detaching, any cross-thread persis tents 136 // For heaps belonging to a thread that's detaching, any cross-thread persis tents
138 // pointing into them needs to be disabled. Do that by clearing out the unde rlying 137 // pointing into them needs to be disabled. Do that by clearing out the unde rlying
(...skipping 24 matching lines...) Expand all
163 if (page->arena()->getThreadState() == threadState) { 162 if (page->arena()->getThreadState() == threadState) {
164 persistent->clear(); 163 persistent->clear();
165 ASSERT(slots->m_slot[i].isUnused()); 164 ASSERT(slots->m_slot[i].isUnused());
166 } 165 }
167 } 166 }
168 slots = slots->m_next; 167 slots = slots->m_next;
169 } 168 }
170 } 169 }
171 170
172 } // namespace blink 171 } // 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