Home | History | Annotate | Download | only in tests
      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.
      4 
      5 #include "virtual_and_trace_after_dispatch.h"
      6 
      7 namespace blink {
      8 
      9 static B* toB(A* a) { return static_cast<B*>(a); }
     10 
     11 void A::Trace(Visitor* visitor)
     12 {
     13     switch (m_type) {
     14     case TB:
     15         toB(this)->TraceAfterDispatch(visitor);
     16         break;
     17     }
     18 }
     19 
     20 void A::TraceAfterDispatch(Visitor* visitor)
     21 {
     22 }
     23 
     24 void B::TraceAfterDispatch(Visitor* visitor)
     25 {
     26     visitor->Trace(m_a);
     27     A::TraceAfterDispatch(visitor);
     28 }
     29 
     30 }
     31