| Index: third_party/WebKit/Source/platform/heap/Visitor.cpp
|
| diff --git a/third_party/WebKit/Source/platform/heap/Visitor.cpp b/third_party/WebKit/Source/platform/heap/Visitor.cpp
|
| index 575285dae0c896bfdf62befc8351adbe3fc429ae..6f5d00fbaf3f812f5692f202b3d57277f2a446e4 100644
|
| --- a/third_party/WebKit/Source/platform/heap/Visitor.cpp
|
| +++ b/third_party/WebKit/Source/platform/heap/Visitor.cpp
|
| @@ -10,35 +10,36 @@
|
|
|
| namespace blink {
|
|
|
| -VisitorScope::VisitorScope(ThreadState* state, BlinkGC::GCType gcType)
|
| - : m_state(state)
|
| +PassOwnPtr<Visitor> Visitor::create(ThreadState* state, BlinkGC::GCType gcType)
|
| {
|
| - // See ThreadState::runScheduledGC() why we need to already be in a
|
| - // GCForbiddenScope before any safe point is entered.
|
| - m_state->enterGCForbiddenScope();
|
| -
|
| - ASSERT(m_state->checkThread());
|
| -
|
| switch (gcType) {
|
| case BlinkGC::GCWithSweep:
|
| case BlinkGC::GCWithoutSweep:
|
| - m_visitor = adoptPtr(new MarkingVisitor<Visitor::GlobalMarking>());
|
| - break;
|
| + return adoptPtr(new MarkingVisitor<Visitor::GlobalMarking>(state));
|
| case BlinkGC::TakeSnapshot:
|
| - m_visitor = adoptPtr(new MarkingVisitor<Visitor::SnapshotMarking>());
|
| - break;
|
| + return adoptPtr(new MarkingVisitor<Visitor::SnapshotMarking>(state));
|
| case BlinkGC::ThreadTerminationGC:
|
| - m_visitor = adoptPtr(new MarkingVisitor<Visitor::ThreadLocalMarking>());
|
| - break;
|
| + return adoptPtr(new MarkingVisitor<Visitor::ThreadLocalMarking>(state));
|
| case BlinkGC::ThreadLocalWeakProcessing:
|
| - m_visitor = adoptPtr(new MarkingVisitor<Visitor::WeakProcessing>());
|
| - break;
|
| + return adoptPtr(new MarkingVisitor<Visitor::WeakProcessing>(state));
|
| default:
|
| ASSERT_NOT_REACHED();
|
| }
|
| + return nullptr;
|
| +}
|
| +
|
| +Visitor::Visitor(ThreadState* state, MarkingMode markingMode)
|
| + : m_state(state)
|
| + , m_markingMode(markingMode)
|
| +{
|
| + // See ThreadState::runScheduledGC() why we need to already be in a
|
| + // GCForbiddenScope before any safe point is entered.
|
| + m_state->enterGCForbiddenScope();
|
| +
|
| + ASSERT(m_state->checkThread());
|
| }
|
|
|
| -VisitorScope::~VisitorScope()
|
| +Visitor::~Visitor()
|
| {
|
| m_state->leaveGCForbiddenScope();
|
| }
|
|
|