Commit dcd3ff02 authored by Mustaq Ahmed's avatar Mustaq Ahmed Committed by Commit Bot

Reduce the time to ignore PointerLock requests after a lock exit.

We encountered use-cases where the user hits the Esc key to release a
PointerLock then expects to request another lock soon afterwards.  If
the second request comes within 2secs of the Esc keypress, we have been
deliberately ignoring the second request to suppress abusive uses of
requestPointerLock (e.g. to prevent users from exiting the locked state,
see crbug.com/1084618).

To address the above problem while also preventing abusive uses, this CL
reduces the delay to 1.25sec as a trade-off.

Fixed: 1127223
Change-Id: I37a5e8e16e8387ac4717fc90fecf946257199575
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505911Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822137}
parent cf2ccbdd
...@@ -29,7 +29,7 @@ const char kMouseLockBubbleReshowsHistogramName[] = ...@@ -29,7 +29,7 @@ const char kMouseLockBubbleReshowsHistogramName[] =
// The amount of time to disallow repeated pointer lock calls after the user // The amount of time to disallow repeated pointer lock calls after the user
// successfully escapes from one lock request. // successfully escapes from one lock request.
constexpr base::TimeDelta kEffectiveUserEscapeDuration = constexpr base::TimeDelta kEffectiveUserEscapeDuration =
base::TimeDelta::FromMilliseconds(2000); base::TimeDelta::FromMilliseconds(1250);
} // namespace } // namespace
......
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