Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / tests / virtual_and_trace_after_dispatch.cpp
blob2ba6f1eea69ecd820db4cba3a068e652f771ed5c
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
3 // found in the LICENSE file.
5 #include "virtual_and_trace_after_dispatch.h"
7 namespace blink {
9 static B* toB(A* a) { return static_cast<B*>(a); }
11 void A::trace(Visitor* visitor)
13 switch (m_type) {
14 case TB:
15 toB(this)->traceAfterDispatch(visitor);
16 break;
20 void A::traceAfterDispatch(Visitor* visitor)
24 void B::traceAfterDispatch(Visitor* visitor)
26 visitor->trace(m_a);
27 A::traceAfterDispatch(visitor);