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

Unified Diff: ash/common/shelf/wm_shelf.cc

Issue 2549833002: Adds tracing to investigate infinite calls to SetAutoHideBehavior (Closed)
Patch Set: Adds tracing to investigate infinite calls to SetAutoHideBehavior (nits) Created 4 years 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 | « ash/common/shelf/wm_shelf.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/wm_shelf.cc
diff --git a/ash/common/shelf/wm_shelf.cc b/ash/common/shelf/wm_shelf.cc
index ffa969a7951bb3b2b558d3940930246e965b9a2d..e439381929be6836869bb732665d2bf36d8c5d57 100644
--- a/ash/common/shelf/wm_shelf.cc
+++ b/ash/common/shelf/wm_shelf.cc
@@ -166,6 +166,19 @@ int WmShelf::PrimaryAxisValue(int horizontal, int vertical) const {
void WmShelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) {
DCHECK(shelf_layout_manager_);
+ // Force a stack dump when this method is invoked too frequently.
+ // This block is here temporary to help investigate http://crbug.com/665093 .
+ constexpr int kAutoHideRepeatInterval = 10000;
+ constexpr int kMaxAutoHideChangesIn10Seconds = 100;
+ if ((base::TimeTicks::Now() - time_last_auto_hide_change_).InMilliseconds() <
+ kAutoHideRepeatInterval) {
+ if (++count_auto_hide_changes_ > kMaxAutoHideChangesIn10Seconds)
+ CHECK(false);
+ } else {
+ count_auto_hide_changes_ = 0;
+ }
+ time_last_auto_hide_change_ = base::TimeTicks::Now();
+
if (auto_hide_behavior_ == auto_hide_behavior)
return;
« no previous file with comments | « ash/common/shelf/wm_shelf.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698