From 0dd4403b3a71addbb94e6ebc3af6b505d0e00a83 Mon Sep 17 00:00:00 2001 From: Valery Arkhangorodsky Date: Mon, 23 Jan 2017 22:35:10 -0500 Subject: [PATCH] Removes a tracing CHECK supposed to investigate infinite SetAutoHideBehavior Having the CHECK in stable channel won't give us anything new and it is unfortunately too easy to trigger it (switch profiles repeatedly). Therefore removing the CHECK. This effectively rolls back those 2 changes: https://codereview.chromium.org/2549833002 https://codereview.chromium.org/2562413003 The change will need to be merged in M-56. BUG=665093 Review-Url: https://codereview.chromium.org/2650853003 Cr-Commit-Position: refs/heads/master@{#445567} (cherry picked from commit 1fd4837307a64feabfdb9e2e0d4ba92a40de4738) Review-Url: https://codereview.chromium.org/2649033005 . Cr-Commit-Position: refs/branch-heads/2987@{#55} Cr-Branched-From: ad51088c0e8776e8dcd963dbe752c4035ba6dab6-refs/heads/master@{#444943} --- ash/common/shelf/wm_shelf.cc | 15 +-------------- ash/common/shelf/wm_shelf.h | 5 ----- ash/shelf/shelf_layout_manager_unittest.cc | 4 ---- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/ash/common/shelf/wm_shelf.cc b/ash/common/shelf/wm_shelf.cc index 75bf105b16d6..72de8ab0b688 100644 --- a/ash/common/shelf/wm_shelf.cc +++ b/ash/common/shelf/wm_shelf.cc @@ -58,7 +58,7 @@ class WmShelf::AutoHideEventHandler : public ui::EventHandler { // WmShelf --------------------------------------------------------------------- -WmShelf::WmShelf() : time_last_auto_hide_change_(base::TimeTicks::Now()) {} +WmShelf::WmShelf() {} WmShelf::~WmShelf() {} @@ -213,19 +213,6 @@ void WmShelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { 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 = 1000; - constexpr int kMaxAutoHideChanges = 20; - if ((base::TimeTicks::Now() - time_last_auto_hide_change_).InMilliseconds() < - kAutoHideRepeatInterval) { - if (++count_auto_hide_changes_ > kMaxAutoHideChanges) - CHECK(false); - } else { - count_auto_hide_changes_ = 0; - } - time_last_auto_hide_change_ = base::TimeTicks::Now(); - auto_hide_behavior_ = auto_hide_behavior; WmShell::Get()->shelf_controller()->NotifyShelfAutoHideBehaviorChanged(this); WmShell::Get()->NotifyShelfAutoHideBehaviorChanged( diff --git a/ash/common/shelf/wm_shelf.h b/ash/common/shelf/wm_shelf.h index 64b00620ac88..ee88e94b1525 100644 --- a/ash/common/shelf/wm_shelf.h +++ b/ash/common/shelf/wm_shelf.h @@ -11,7 +11,6 @@ #include "ash/common/shelf/shelf_layout_manager_observer.h" #include "ash/public/cpp/shelf_types.h" #include "base/observer_list.h" -#include "base/time/time.h" namespace gfx { class Rect; @@ -172,10 +171,6 @@ class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver { base::ObserverList observers_; - // Temporary. Used to investigate http://crbug.com/665093 . - base::TimeTicks time_last_auto_hide_change_; - int count_auto_hide_changes_ = 0; - // Forwards mouse and gesture events to ShelfLayoutManager for auto-hide. // TODO(mash): Facilitate simliar functionality in mash: crbug.com/631216 std::unique_ptr auto_hide_event_handler_; diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 550307ec8f18..b5ee95f46135 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc @@ -581,10 +581,6 @@ void ShelfLayoutManagerTest::RunGestureDragTests(gfx::Vector2d delta) { EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); - - // Avoid a CHECK that makes sure SetAutoHideBehavior is not called too - // frequently. This is to help investigate http://crbug.com/665093 . - shelf->count_auto_hide_changes_ = 0; } // Makes sure SetVisible updates work area and widget appropriately.