| 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 { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Without this hack, we need to use visitor.trace() for | 26 // Without this hack, we need to use visitor.trace() for |
| 27 // trace(InlinedGlobalMarkingVisitor) and visitor->trace() for | 27 // trace(InlinedGlobalMarkingVisitor) and visitor->trace() for |
| 28 // trace(Visitor*). | 28 // trace(Visitor*). |
| 29 InlinedGlobalMarkingVisitor* operator->() { return this; } | 29 InlinedGlobalMarkingVisitor* operator->() { return this; } |
| 30 | 30 |
| 31 using Impl::mark; | 31 using Impl::mark; |
| 32 using Impl::ensureMarked; | 32 using Impl::ensureMarked; |
| 33 using Impl::registerDelayedMarkNoTracing; | 33 using Impl::registerDelayedMarkNoTracing; |
| 34 using Impl::registerWeakTable; | 34 using Impl::registerWeakTable; |
| 35 using Impl::registerWeakMembers; | 35 using Impl::registerWeakMembers; |
| 36 #if ENABLE(ASSERT) | 36 #if DCHECK_IS_ON() |
| 37 using Impl::weakTableRegistered; | 37 using Impl::weakTableRegistered; |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 template <typename T> | 40 template <typename T> |
| 41 void mark(T* t) { | 41 void mark(T* t) { |
| 42 Helper::mark(t); | 42 Helper::mark(t); |
| 43 } | 43 } |
| 44 | 44 |
| 45 template <typename T, void (T::*method)(Visitor*)> | 45 template <typename T, void (T::*method)(Visitor*)> |
| 46 void registerWeakMembers(const T* obj) { | 46 void registerWeakMembers(const T* obj) { |
| 47 Helper::template registerWeakMembers<T, method>(obj); | 47 Helper::template registerWeakMembers<T, method>(obj); |
| 48 } | 48 } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 static InlinedGlobalMarkingVisitor fromHelper(Helper* helper) { | 51 static InlinedGlobalMarkingVisitor fromHelper(Helper* helper) { |
| 52 return *static_cast<InlinedGlobalMarkingVisitor*>(helper); | 52 return *static_cast<InlinedGlobalMarkingVisitor*>(helper); |
| 53 } | 53 } |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 inline void GarbageCollectedMixin::trace(InlinedGlobalMarkingVisitor) {} | 56 inline void GarbageCollectedMixin::trace(InlinedGlobalMarkingVisitor) {} |
| 57 | 57 |
| 58 } // namespace blink | 58 } // namespace blink |
| 59 | 59 |
| 60 #endif | 60 #endif |
| OLD | NEW |