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

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

Issue 804303002: Implement Visitor::isGlobalMarkingVisitor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix build 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/HeapTest.cpp ('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 8605f31fbeeff903ff5166e93c63bf4771bb92d5..038253f3e2ebe9612ba0e92b5ab28cc7392c86b6 100644
--- a/Source/platform/heap/Visitor.h
+++ b/Source/platform/heap/Visitor.h
@@ -478,6 +478,11 @@ class PLATFORM_EXPORT Visitor : public VisitorHelper<Visitor> {
public:
friend class VisitorHelper<Visitor>;
+ enum VisitorType {
+ GlobalMarkingVisitorType,
+ GenericVisitorType,
+ };
+
virtual ~Visitor() { }
// FIXME: This is a temporary hack to cheat old Blink GC plugin checks.
@@ -569,9 +574,12 @@ public:
inline void incrementTraceDepth() { m_traceDepth++; }
inline void decrementTraceDepth() { ASSERT(m_traceDepth > 0); m_traceDepth--; }
+ inline bool isGlobalMarkingVisitor() const { return m_isGlobalMarkingVisitor; }
+
protected:
- Visitor()
+ explicit Visitor(VisitorType type)
: m_traceDepth(0)
+ , m_isGlobalMarkingVisitor(type == GlobalMarkingVisitorType)
{
}
@@ -587,6 +595,7 @@ private:
const int kMaxEagerTraceDepth = 100;
int m_traceDepth;
+ bool m_isGlobalMarkingVisitor;
};
// We trace vectors by using the trace trait on each element, which means you
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698