0

Revert "DumpWithoutCrashing if key repeat heuristic disagrees with native event"

This reverts commit 3f542c0a2a.

Reason for revert: Crash rate too high; may impact other crash reports uploads.

Bug: 411681432, 40940886
Original change's description:
> DumpWithoutCrashing if key repeat heuristic disagrees with native event
>
> DumpWithoutCrashing if IsRepeated thinks a key event should have its
> repeat flag set but the native event says otherwise. This is unexpected,
> but execution is permitted to continue as it is no worse than the old
> behavior.
>
> If crash reports do come in, it likely means that the key repeat
> information from the native event was either incorrect or not preserved,
> which should be fixed. If no crash reports come in, then IsRepeated can
> be safely removed.
>
> Bug: 411681432, 40940886
> Change-Id: I32dcb1e57f69966a0e75a0d775a1e196216cb272
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6473307
> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> Commit-Queue: Alex Yang <aycyang@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1452752}

Bug: 411681432, 40940886
Change-Id: I3a065e7356d1c10b3761c8c7d4a41a0e738220a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6499308
Reviewed-by: Prudhvikumar Bommana <pbommana@google.com>
Commit-Queue: Prudhvikumar Bommana <pbommana@google.com>
Owners-Override: Prudhvikumar Bommana <pbommana@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1453662}
This commit is contained in:
Alex Yang
2025-04-29 18:04:39 -07:00
committed by Chromium LUCI CQ
parent 2d8b66e817
commit b83b6f836d

@ -10,7 +10,6 @@
#include <string>
#include <utility>
#include "base/debug/dump_without_crashing.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
@ -887,18 +886,8 @@ void KeyEvent::InitializeNative() {
// Check if this is a key repeat. This must be called before initial flags
// processing, e.g: NormalizeFlags(), to avoid issues like crbug.com/1069690.
if (synthesize_key_repeat_enabled_ && IsRepeated(GetLastKeyEvent())) {
if (!(flags() & EF_IS_REPEAT)) {
// If this branch is reached, it means that IsRepeated thinks this should
// be a repeat key event, while the native event repeat information was
// either incorrect or not preserved. This is unexpected, but execution
// is permitted to continue as it is no worse than the old behavior.
// TODO(https://crbug.com/411681432) Remove IsRepeated once it is deemed
// strictly redundant.
base::debug::DumpWithoutCrashing();
}
if (synthesize_key_repeat_enabled_ && IsRepeated(GetLastKeyEvent()))
SetFlags(flags() | EF_IS_REPEAT);
}
#if BUILDFLAG(IS_LINUX)
NormalizeFlags();