1 // Copyright 2015 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 #ifndef TOOLS_BLINK_GC_PLUGIN_CHECK_GC_ROOTS_VISITOR_H_
6 #define TOOLS_BLINK_GC_PLUGIN_CHECK_GC_ROOTS_VISITOR_H_
12 #include "RecordInfo.h"
14 // This visitor checks that the fields of a class and the fields of
15 // its part objects don't define GC roots.
16 class CheckGCRootsVisitor
: public RecursiveEdgeVisitor
{
18 typedef std::vector
<FieldPoint
*> RootPath
;
19 typedef std::set
<RecordInfo
*> VisitingSet
;
20 typedef std::vector
<RootPath
> Errors
;
22 CheckGCRootsVisitor();
26 bool ContainsGCRoots(RecordInfo
* info
);
28 void VisitValue(Value
* edge
) override
;
29 void VisitPersistent(Persistent
* edge
) override
;
30 void AtCollection(Collection
* edge
) override
;
34 VisitingSet visiting_set_
;
38 #endif // TOOLS_BLINK_GC_PLUGIN_CHECK_GC_ROOTS_VISITOR_H_