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

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

Issue 2562413003: Changes threshold frequency for investigation (based on video in the bug) (Closed)
Patch Set: Changes threshold frequency for investigation (fxed a test and reworked math) 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') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | 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 87392334d4f62b39757a7cd339b14da401701d69..a86a9915a3f02315610627c1a69a46971b185e69 100644
--- a/ash/common/shelf/wm_shelf.cc
+++ b/ash/common/shelf/wm_shelf.cc
@@ -166,22 +166,22 @@ int WmShelf::PrimaryAxisValue(int horizontal, int vertical) const {
void WmShelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) {
DCHECK(shelf_layout_manager_);
+ if (auto_hide_behavior_ == auto_hide_behavior)
+ return;
+
// 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;
+ constexpr int kAutoHideRepeatInterval = 1000;
+ constexpr int kMaxAutoHideChanges = 20;
if ((base::TimeTicks::Now() - time_last_auto_hide_change_).InMilliseconds() <
kAutoHideRepeatInterval) {
- if (++count_auto_hide_changes_ > kMaxAutoHideChangesIn10Seconds)
+ if (++count_auto_hide_changes_ > kMaxAutoHideChanges)
CHECK(false);
} else {
count_auto_hide_changes_ = 0;
}
time_last_auto_hide_change_ = base::TimeTicks::Now();
- if (auto_hide_behavior_ == auto_hide_behavior)
- return;
-
auto_hide_behavior_ = auto_hide_behavior;
WmShell::Get()->shelf_controller()->NotifyShelfAutoHideBehaviorChanged(this);
WmShell::Get()->NotifyShelfAutoHideBehaviorChanged(
@@ -309,7 +309,7 @@ ShelfView* WmShelf::GetShelfViewForTesting() {
return shelf_view_;
}
-WmShelf::WmShelf() {}
+WmShelf::WmShelf() : time_last_auto_hide_change_(base::TimeTicks::Now()) {}
WmShelf::~WmShelf() {}
« no previous file with comments | « ash/common/shelf/wm_shelf.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698