| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 InlinedGlobalMarkingVisitor_h | 5 #ifndef InlinedGlobalMarkingVisitor_h |
| 6 #define InlinedGlobalMarkingVisitor_h | 6 #define InlinedGlobalMarkingVisitor_h |
| 7 | 7 |
| 8 #include "platform/heap/MarkingVisitorImpl.h" | 8 #include "platform/heap/MarkingVisitorImpl.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class InlinedGlobalMarkingVisitor final : public VisitorHelper<InlinedGlobalMark
ingVisitor>, public MarkingVisitorImpl<InlinedGlobalMarkingVisitor> { | 12 class InlinedGlobalMarkingVisitor final : public VisitorHelper<InlinedGlobalMark
ingVisitor>, public MarkingVisitorImpl<InlinedGlobalMarkingVisitor> { |
| 13 public: | 13 public: |
| 14 friend class VisitorHelper<InlinedGlobalMarkingVisitor>; | 14 friend class VisitorHelper<InlinedGlobalMarkingVisitor>; |
| 15 using Helper = VisitorHelper<InlinedGlobalMarkingVisitor>; | 15 using Helper = VisitorHelper<InlinedGlobalMarkingVisitor>; |
| 16 friend class MarkingVisitorImpl<InlinedGlobalMarkingVisitor>; | 16 friend class MarkingVisitorImpl<InlinedGlobalMarkingVisitor>; |
| 17 using Impl = MarkingVisitorImpl<InlinedGlobalMarkingVisitor>; | 17 using Impl = MarkingVisitorImpl<InlinedGlobalMarkingVisitor>; |
| 18 | 18 |
| 19 explicit InlinedGlobalMarkingVisitor(Visitor* visitor) | 19 explicit InlinedGlobalMarkingVisitor(Visitor* visitor) |
| 20 : m_visitor(visitor) | 20 : VisitorHelper(visitor->gcData()) |
| 21 , m_visitor(visitor) |
| 21 { | 22 { |
| 22 ASSERT(visitor->markingMode() == Visitor::GlobalMarking); | 23 ASSERT(visitor->markingMode() == Visitor::GlobalMarking); |
| 23 } | 24 } |
| 24 | 25 |
| 25 // Hack to unify interface to visitor->trace(). | 26 // Hack to unify interface to visitor->trace(). |
| 26 // Without this hack, we need to use visitor.trace() for | 27 // Without this hack, we need to use visitor.trace() for |
| 27 // trace(InlinedGlobalMarkingVisitor) and visitor->trace() for trace(Visitor
*). | 28 // trace(InlinedGlobalMarkingVisitor) and visitor->trace() for trace(Visitor
*). |
| 28 InlinedGlobalMarkingVisitor* operator->() { return this; } | 29 InlinedGlobalMarkingVisitor* operator->() { return this; } |
| 29 | 30 |
| 30 using Impl::mark; | 31 using Impl::mark; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 Visitor* m_visitor; | 73 Visitor* m_visitor; |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 inline void GarbageCollectedMixin::trace(InlinedGlobalMarkingVisitor) | 76 inline void GarbageCollectedMixin::trace(InlinedGlobalMarkingVisitor) |
| 76 { | 77 { |
| 77 } | 78 } |
| 78 | 79 |
| 79 } // namespace blink | 80 } // namespace blink |
| 80 | 81 |
| 81 #endif | 82 #endif |
| OLD | NEW |