Skip to content

Commit

Permalink
Removes a tracing CHECK supposed to investigate infinite SetAutoHideB…
Browse files Browse the repository at this point in the history
…ehavior

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}
  • Loading branch information
varkha authored and Commit bot committed Jan 24, 2017
1 parent 25680c6 commit 1fd4837
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
15 changes: 1 addition & 14 deletions ash/common/shelf/wm_shelf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down Expand Up @@ -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(
Expand Down
5 changes: 0 additions & 5 deletions ash/common/shelf/wm_shelf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -172,10 +171,6 @@ class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver {

base::ObserverList<WmShelfObserver> 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<AutoHideEventHandler> auto_hide_event_handler_;
Expand Down
4 changes: 0 additions & 4 deletions ash/shelf/shelf_layout_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1fd4837

Please sign in to comment.