Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp

Issue 2657253003: Make ScrollPaintPropertyNode::toString() 26% more concise (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp
index e3a09aa3a98d8733633586aa71c53378ce9af4d3..24afc52f450b7877f176d682243572737d5a6e8f 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp
@@ -16,18 +16,31 @@ ScrollPaintPropertyNode* ScrollPaintPropertyNode::root() {
}
String ScrollPaintPropertyNode::toString() const {
- std::string mainThreadScrollingReasonsAsText =
- MainThreadScrollingReason::mainThreadScrollingReasonsAsText(
- m_mainThreadScrollingReasons);
- return String::format(
- "parent=%p clip=%s bounds=%s "
- "userScrollableHorizontal=%s"
- " userScrollableVertical=%s mainThreadScrollingReasons=%s",
- m_parent.get(), m_clip.toString().ascii().data(),
- m_bounds.toString().ascii().data(),
- m_userScrollableHorizontal ? "yes" : "no",
- m_userScrollableVertical ? "yes" : "no",
- mainThreadScrollingReasonsAsText.c_str());
+ StringBuilder text;
+ text.append("parent=");
+ text.append(String::format("%p", m_parent.get()));
+ text.append(" clip=");
+ text.append(m_clip.toString());
+ text.append(" bounds=");
+ text.append(m_bounds.toString());
+
+ text.append(" userScrollable=");
+ if (m_userScrollableHorizontal && m_userScrollableVertical)
+ text.append("both");
+ else if (!m_userScrollableHorizontal && !m_userScrollableHorizontal)
brucedawson 2017/01/31 20:21:28 The experimental /analyze builder pointed out that
+ text.append("none");
+ else
+ text.append(m_userScrollableHorizontal ? "horizontal" : "vertical");
+
+ text.append(" mainThreadReasons=");
+ if (m_mainThreadScrollingReasons) {
+ text.append(MainThreadScrollingReason::mainThreadScrollingReasonsAsText(
+ m_mainThreadScrollingReasons)
+ .c_str());
+ } else {
+ text.append("none");
+ }
+ return text.toString();
}
#if DCHECK_IS_ON()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698