DescriptionRefactor Node::showTree*() functions.
Update them so that they return strings instead of calling Node::showNode(),
which uses WTFLogAlways().
- Rename showTreeForThis() to toTreeStringForThis()
- Rename showTreeForThisInFlatTree() to toFlatTreeStringForThis()
- Rename showTreeAndMark() to toMarkedTreeString().
- Rename showTreeAndMarkInFlatTree() to toMarkedFlatTreeString()
- Rename traverseTreeAndMark() to appendMarkedTree()
- Rename traverseTreeAndMarkInFlatTree() to appendMarkedFlatTree()
- Add Node::toString() to help these functions.
We'd like to return a string rather than taking a std::ostream argument because
they are used with LOG macros. For example,
VLOG(1) << node.toMarkedTreeString().utf8().data() << "...";
If we took a std::ostream argument, the code would be:
std::stringstream buffer;
node.printMarkedTreeTo(buffer);
VLOG(1) << buffer.str() << "...";
The former is simpler.
This CL doesn't affect production.
BUG=638849
Committed: https://crrev.com/5186386bfed2c08c2253c65652f385859ed3af57
Cr-Commit-Position: refs/heads/master@{#415154}
Patch Set 1 #
Messages
Total messages: 16 (11 generated)
|