Commit 5823b44a authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Revert "Change the history state throttle interval from 60 to 120 Hz."

This reverts commit 8e4127dd.

Reason for revert: Part 1 of trying to revert the history throttling changes, to see if https://bugs.chromium.org/p/chromium/issues/detail?id=870861 improves.

Original change's description:
> Change the history state throttle interval from 60 to 120 Hz.
> 
> This is a bit more lenient and may enable some callers, including a flaky test,
> to get (more of) what they need. The test's root problem seems to be data races
> (see issue 847326), however.
> 
> Bug: 870861
> Change-Id: I249e9f06fa9a9a9f3b74e53cf2ef3f34b0c2371c
> Reviewed-on: https://chromium-review.googlesource.com/1171825
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Chris Palmer <palmer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#582415}

TBR=palmer@chromium.org,dcheng@chromium.org,kinuko@chromium.org

Change-Id: I9fb7b5b0f8ebff8b6d6c5a772745cfd2c10ef51a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 870861
Reviewed-on: https://chromium-review.googlesource.com/1171708Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582432}
parent acd58b3a
......@@ -155,12 +155,11 @@ bool History::ShouldThrottleStateObjectChanges() {
const auto now = TimeTicks::Now();
const TimeDelta elapsed = now - state_flood_guard.last_token_grant;
static constexpr base::TimeDelta kTokenRefreshInterval =
base::TimeDelta::FromMilliseconds(8);
static constexpr base::TimeDelta kTimePerToken =
base::TimeDelta::FromMilliseconds(16);
static constexpr int kMaxTokens = 50;
// It is OK to truncate from int64_t to int here.
const int tokens_earned =
std::min<int>(elapsed / kTokenRefreshInterval, kMaxTokens);
const int tokens_earned = std::min<int>(elapsed / kTimePerToken, kMaxTokens);
if (tokens_earned > 0) {
state_flood_guard.tokens = tokens_earned - 1; // One consumed immediately.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment