Chromium Code Reviews| 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..fdc010ee5944228dc24e64c4026e0b106be9a2da 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 . |
| + const int kAutoHideRepeatInterval = 10000; |
| + const int kMaxAutoHideChangesIn10Seconds = 100; |
|
oshima
2016/12/05 20:28:54
nit: constexpr
varkha
2016/12/05 20:41:21
Done.
|
| + 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; |