Commit 8443de77 authored by David Bokan's avatar David Bokan Committed by Commit Bot

Add TRACE logging for browser controls

Needed to debug unexplained behavior seen in browser controls that
don't reproduce in a local Chrome build.

Bug: 861618
Change-Id: I9a6769cd47a3329313628bd714039ec532fc3d94
Reviewed-on: https://chromium-review.googlesource.com/c/1351272Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610963}
parent 7e14a87d
...@@ -94,6 +94,10 @@ void BrowserControlsOffsetManager::UpdateBrowserControlsState( ...@@ -94,6 +94,10 @@ void BrowserControlsOffsetManager::UpdateBrowserControlsState(
DCHECK(!(constraints == BrowserControlsState::kHidden && DCHECK(!(constraints == BrowserControlsState::kHidden &&
current == BrowserControlsState::kShown)); current == BrowserControlsState::kShown));
TRACE_EVENT2("cc", "BrowserControlsOffsetManager::UpdateBrowserControlsState",
"constraints", static_cast<int>(constraints), "current",
static_cast<int>(current));
// If the constraints have changed we need to inform Blink about it since // If the constraints have changed we need to inform Blink about it since
// that'll affect main thread scrolling as well as layout. // that'll affect main thread scrolling as well as layout.
if (permitted_state_ != constraints) { if (permitted_state_ != constraints) {
...@@ -114,6 +118,7 @@ void BrowserControlsOffsetManager::UpdateBrowserControlsState( ...@@ -114,6 +118,7 @@ void BrowserControlsOffsetManager::UpdateBrowserControlsState(
current == BrowserControlsState::kHidden) current == BrowserControlsState::kHidden)
final_shown_ratio = 0.f; final_shown_ratio = 0.f;
if (final_shown_ratio == TopControlsShownRatio()) { if (final_shown_ratio == TopControlsShownRatio()) {
TRACE_EVENT_INSTANT0("cc", "Ratio Unchanged", TRACE_EVENT_SCOPE_THREAD);
ResetAnimations(); ResetAnimations();
return; return;
} }
......
...@@ -969,6 +969,8 @@ bool LayerTreeImpl::ClampBrowserControlsShownRatio() { ...@@ -969,6 +969,8 @@ bool LayerTreeImpl::ClampBrowserControlsShownRatio() {
} }
bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) {
TRACE_EVENT1("cc", "LayerTreeImpl::SetCurrentBrowserControlsShownRatio",
"ratio", ratio);
bool changed = top_controls_shown_ratio_->SetCurrent(ratio); bool changed = top_controls_shown_ratio_->SetCurrent(ratio);
changed |= ClampBrowserControlsShownRatio(); changed |= ClampBrowserControlsShownRatio();
return changed; return changed;
......
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