Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::CounterVisitor Class Reference
Inheritance diagram for dart::CounterVisitor:

Public Member Functions

 CounterVisitor (ObjectPtr skip, ObjectPtr expected_parent)
 
virtual Direction VisitObject (ObjectGraph::StackIterator *it)
 
int count () const
 
int size () const
 

Detailed Description

Definition at line 13 of file object_graph_test.cc.

Constructor & Destructor Documentation

◆ CounterVisitor()

dart::CounterVisitor::CounterVisitor ( ObjectPtr  skip,
ObjectPtr  expected_parent 
)
inline

Definition at line 17 of file object_graph_test.cc.

18 : count_(0), size_(0), skip_(skip), expected_parent_(expected_parent) {}
static bool skip(SkStream *stream, size_t amount)

Member Function Documentation

◆ count()

int dart::CounterVisitor::count ( ) const
inline

Definition at line 32 of file object_graph_test.cc.

32{ return count_; }

◆ size()

int dart::CounterVisitor::size ( ) const
inline

Definition at line 33 of file object_graph_test.cc.

33{ return size_; }

◆ VisitObject()

virtual Direction dart::CounterVisitor::VisitObject ( ObjectGraph::StackIterator *  it)
inlinevirtual

Definition at line 20 of file object_graph_test.cc.

20 {
21 ObjectPtr obj = it->Get();
22 if (obj == skip_) {
23 EXPECT(it->MoveToParent());
24 EXPECT_EQ(expected_parent_, it->Get());
25 return kBacktrack;
26 }
27 ++count_;
28 size_ += obj->untag()->HeapSize();
29 return kProceed;
30 }
#define EXPECT(type, expectedAlignment, expectedSize)

The documentation for this class was generated from the following file: