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

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

Issue 2106863003: Handle cross-thread weak persistents during global weak processing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: only treat cross-thread weaks during global weak processing Created 4 years, 5 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 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 #ifndef MarkingVisitor_h 5 #ifndef MarkingVisitor_h
6 #define MarkingVisitor_h 6 #define MarkingVisitor_h
7 7
8 #include "platform/heap/MarkingVisitorImpl.h" 8 #include "platform/heap/MarkingVisitorImpl.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 { 50 {
51 return Impl::weakTableRegistered(closure); 51 return Impl::weakTableRegistered(closure);
52 } 52 }
53 #endif 53 #endif
54 54
55 bool ensureMarked(const void* objectPointer) override 55 bool ensureMarked(const void* objectPointer) override
56 { 56 {
57 return Impl::ensureMarked(objectPointer); 57 return Impl::ensureMarked(objectPointer);
58 } 58 }
59 59
60 protected:
61 void registerWeakCellWithCallback(void** cell, WeakCallback callback) overri de 60 void registerWeakCellWithCallback(void** cell, WeakCallback callback) overri de
62 { 61 {
63 Impl::registerWeakCellWithCallback(cell, callback); 62 Impl::registerWeakCellWithCallback(cell, callback);
64 } 63 }
65 64
65 protected:
66 inline bool shouldMarkObject(const void* objectPointer) const 66 inline bool shouldMarkObject(const void* objectPointer) const
67 { 67 {
68 if (Mode != ThreadLocalMarking) 68 if (Mode != ThreadLocalMarking)
69 return true; 69 return true;
70 70
71 BasePage* page = pageFromObject(objectPointer); 71 BasePage* page = pageFromObject(objectPointer);
72 ASSERT(!page->orphaned()); 72 ASSERT(!page->orphaned());
73 // When doing a thread local GC, the marker checks if 73 // When doing a thread local GC, the marker checks if
74 // the object resides in another thread's heap. If it 74 // the object resides in another thread's heap. If it
75 // does, the object should not be marked & traced. 75 // does, the object should not be marked & traced.
76 return page->terminating(); 76 return page->terminating();
77 } 77 }
78 }; 78 };
79 79
80 } // namespace blink 80 } // namespace blink
81 81
82 #endif 82 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698