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

Unified Diff: Source/platform/heap/Visitor.h

Issue 799453003: Oilpan: fix Windows build after r187674. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add needsTracing argument to TraceCompatibilityAdaptor<> Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/heap/InlinedGlobalMarkingVisitor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Visitor.h
diff --git a/Source/platform/heap/Visitor.h b/Source/platform/heap/Visitor.h
index 3e9d21891861c322483c6dd58d7a454152b75d2e..dce9d8f9acecbd26be562597e4b731c828376206 100644
--- a/Source/platform/heap/Visitor.h
+++ b/Source/platform/heap/Visitor.h
@@ -63,8 +63,37 @@ class HeapObjectHeader;
class InlinedGlobalMarkingVisitor;
template<typename T> class Member;
template<typename T> class WeakMember;
+template<typename ValueArg, size_t inlineCapacity> struct HeapListHashSetAllocator;
class Visitor;
+} // namespace blink
+
+namespace WTF {
+
+template<typename ValueArg, typename Allocator> class ListHashSetNode;
+
+template<typename T>
+struct NeedsTracing<blink::Member<T>> {
+ static const bool value = true;
+};
+
+template<typename T>
+struct IsWeak<blink::WeakMember<T>> {
+ static const bool value = true;
+};
+
+template<typename T, size_t inlineCapacity>
+struct NeedsTracing<ListHashSetNode<T, blink::HeapListHashSetAllocator<T, inlineCapacity>> *> {
+ // All heap allocated node pointers need visiting to keep the nodes alive,
+ // regardless of whether they contain pointers to other heap allocated
+ // objects.
+ static const bool value = true;
+};
+
+} // namespace WTF
+
+namespace blink {
+
template <typename T> struct IsGarbageCollectedType;
#define STATIC_ASSERT_IS_GARBAGE_COLLECTED(T, ErrorMessage) \
static_assert(IsGarbageCollectedType<T>::value, ErrorMessage)
@@ -180,7 +209,7 @@ public:
static const bool value = true;
};
-template <typename T, bool = HasInlinedTraceMethod<T>::value>
+template <typename T, bool needsTracing, bool = HasInlinedTraceMethod<T>::value>
struct TraceCompatibilityAdaptor;
// The TraceTrait is used to specify how to mark an object pointer and
@@ -196,13 +225,14 @@ struct TraceCompatibilityAdaptor;
// that case the pointer has to be adjusted before marking.
template<typename T>
class TraceTrait {
+ static const bool needsTracing = WTF::NeedsTracing<T>::value || WTF::IsWeak<T>::value;
public:
// Default implementation of TraceTrait<T>::trace just statically
// dispatches to the trace method of the class T.
template<typename VisitorDispatcher>
static void trace(VisitorDispatcher visitor, void* self)
{
- TraceCompatibilityAdaptor<T>::trace(visitor, static_cast<T*>(self));
+ TraceCompatibilityAdaptor<T, needsTracing>::trace(visitor, static_cast<T*>(self));
}
template<typename VisitorDispatcher>
« no previous file with comments | « Source/platform/heap/InlinedGlobalMarkingVisitor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698