Commit f70f003f authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Views: more accurate layout tracing

Consider two views: A and its child view B.

The "Views::Layout" trace event for B is currently emitted when A calls
B's Layout as part of A's Layout. This is less intuitive than calling it
in B's Layout, but is better because it can capture an event for a B
which doesn't call through to the base class Layout implementation in
its Layout.

Unfortunately, this still leaves many gaps:
1) Layout managers
2) Views whose *parents* don't call the base class implementation
3) Layouts triggered by bounds changes
4) Probably some more I can't think of right now.

This change adds extra trace events to address #3 from the list above.

Bug: 850128, 835983
Change-Id: I135ac0e8b2c6b9e277dce6da06e9d0aeae7dfbd1
Reviewed-on: https://chromium-review.googlesource.com/1112466
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570065}
parent 07c24bb0
......@@ -325,6 +325,8 @@ void View::SetBoundsRect(const gfx::Rect& bounds) {
if (bounds == bounds_) {
if (needs_layout_) {
needs_layout_ = false;
TRACE_EVENT1("views", "View::Layout(set_bounds)", "class",
GetClassName());
Layout();
}
return;
......@@ -2187,6 +2189,8 @@ void View::BoundsChanged(const gfx::Rect& previous_bounds) {
if (needs_layout_ || previous_bounds.size() != size()) {
needs_layout_ = false;
TRACE_EVENT1("views", "View::Layout(bounds_changed)", "class",
GetClassName());
Layout();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment