Skip to content

Commit 74bec92

Browse files
JoeNotCharlesGoogleChromium LUCI CQ
authored and
Chromium LUCI CQ
committed
Remove Event.Latency.OS_NO_VALIDATION
According to https://crbug.com/1039833#c56 the investigation using this metric is over. R=bokan Bug: 1039833 Change-Id: Iaae37cf2116656a339dbe159074ac955d7a359ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3526413 Reviewed-by: David Bokan <[email protected]> Reviewed-by: Jonathan Ross <[email protected]> Auto-Submit: Joe Mason <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Arthur Sonzogni <[email protected]> Cr-Commit-Position: refs/heads/main@{#981543}
1 parent 75e2036 commit 74bec92

File tree

7 files changed

+4
-92
lines changed

7 files changed

+4
-92
lines changed

content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm

+1-2
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,7 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
972972
// Don't cancel child popups; the key events are probably what's triggering
973973
// the popup in the first place.
974974

975-
NativeWebKeyboardEvent event =
976-
NativeWebKeyboardEvent::CreateForRenderer(theEvent);
975+
NativeWebKeyboardEvent event(theEvent);
977976
ui::LatencyInfo latency_info;
978977
if (event.GetType() == blink::WebInputEvent::Type::kRawKeyDown ||
979978
event.GetType() == blink::WebInputEvent::Type::kChar) {

content/browser/renderer_host/input/web_input_event_builders_mac.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,7 @@ namespace content {
1919

2020
class CONTENT_EXPORT WebKeyboardEventBuilder {
2121
public:
22-
// TODO(bokan): Temporarily added the |record_debug_uma| param to help debug
23-
// https://crbug.com/1039833. This parameter controls whether
24-
// Event.Latency.OS_NO_VALIDATION metrics are collected for the key event.
25-
// The purpose is to limit this to only those events that are being handled
26-
// synchronously from the OS message loop since we can reinject the same
27-
// NSEvent back into the app multiple times; we want to record this stat only
28-
// the first time the event was received.
29-
static blink::WebKeyboardEvent Build(NSEvent* event,
30-
bool record_debug_uma = false);
22+
static blink::WebKeyboardEvent Build(NSEvent* event);
3123
};
3224

3325
class CONTENT_EXPORT WebMouseEventBuilder {

content/browser/renderer_host/input/web_input_event_builders_mac.mm

+1-38
Original file line numberDiff line numberDiff line change
@@ -254,20 +254,8 @@ bool IsSystemKeyEvent(const blink::WebKeyboardEvent& event) {
254254

255255
} // namespace
256256

257-
blink::WebKeyboardEvent WebKeyboardEventBuilder::Build(NSEvent* event,
258-
bool record_debug_uma) {
257+
blink::WebKeyboardEvent WebKeyboardEventBuilder::Build(NSEvent* event) {
259258
ui::ComputeEventLatencyOS(event);
260-
base::TimeTicks now = ui::EventTimeForNow();
261-
base::TimeTicks hardware_timestamp =
262-
ui::EventTimeStampFromSeconds([event timestamp]);
263-
if (record_debug_uma) {
264-
if (ui::EventTypeFromNative(event) == ui::ET_KEY_PRESSED) {
265-
base::TimeDelta diff = (now - hardware_timestamp).magnitude();
266-
UMA_HISTOGRAM_CUSTOM_TIMES(
267-
"Event.Latency.OS_NO_VALIDATION.POSITIVE.KEY_PRESSED", diff,
268-
base::Milliseconds(1), base::Seconds(60), 50);
269-
}
270-
}
271259

272260
ui::DomCode dom_code = ui::DomCodeFromNSEvent(event);
273261
int modifiers =
@@ -327,15 +315,6 @@ bool IsSystemKeyEvent(const blink::WebKeyboardEvent& event) {
327315
blink::WebPointerProperties::PointerType pointerType,
328316
bool unacceleratedMovement) {
329317
ui::ComputeEventLatencyOS(event);
330-
base::TimeTicks now = ui::EventTimeForNow();
331-
base::TimeTicks hardware_timestamp =
332-
ui::EventTimeStampFromSeconds([event timestamp]);
333-
if (ui::EventTypeFromNative(event) == ui::ET_MOUSE_PRESSED) {
334-
base::TimeDelta diff = (now - hardware_timestamp).magnitude();
335-
UMA_HISTOGRAM_CUSTOM_TIMES(
336-
"Event.Latency.OS_NO_VALIDATION.POSITIVE.MOUSE_PRESSED", diff,
337-
base::Milliseconds(1), base::Seconds(60), 50);
338-
}
339318
blink::WebInputEvent::Type event_type =
340319
blink::WebInputEvent::Type::kUndefined;
341320
int click_count = 0;
@@ -454,13 +433,6 @@ bool IsSystemKeyEvent(const blink::WebKeyboardEvent& event) {
454433
NSEvent* event,
455434
NSView* view) {
456435
ui::ComputeEventLatencyOS(event);
457-
base::TimeTicks now = ui::EventTimeForNow();
458-
base::TimeTicks hardware_timestamp =
459-
ui::EventTimeStampFromSeconds([event timestamp]);
460-
base::TimeDelta diff = (now - hardware_timestamp).magnitude();
461-
UMA_HISTOGRAM_CUSTOM_TIMES(
462-
"Event.Latency.OS_NO_VALIDATION.POSITIVE.MOUSE_WHEEL", diff,
463-
base::Milliseconds(1), base::Seconds(60), 50);
464436
blink::WebMouseWheelEvent result(
465437
blink::WebInputEvent::Type::kMouseWheel, ModifiersFromEvent(event),
466438
ui::EventTimeStampFromSeconds([event timestamp]));
@@ -692,15 +664,6 @@ bool IsSystemKeyEvent(const blink::WebKeyboardEvent& event) {
692664

693665
blink::WebTouchEvent result(event_type, ModifiersFromEvent(event),
694666
ui::EventTimeStampFromSeconds([event timestamp]));
695-
if (ui::EventTypeFromNative(event) == ui::ET_TOUCH_PRESSED) {
696-
base::TimeTicks now = ui::EventTimeForNow();
697-
base::TimeTicks hardware_timestamp =
698-
ui::EventTimeStampFromSeconds([event timestamp]);
699-
UMA_HISTOGRAM_CUSTOM_TIMES(
700-
"Event.Latency.OS.NO_VALIDATION.POSITIVE.TOUCH_PRESSED",
701-
(now - hardware_timestamp).magnitude(), base::Milliseconds(1),
702-
base::Seconds(60), 50);
703-
}
704667
ui::ComputeEventLatencyOS(event);
705668
result.hovering = event_type == blink::WebInputEvent::Type::kTouchEnd;
706669
result.unique_touch_event_id = ui::GetNextTouchEventId();

content/browser/renderer_host/native_web_keyboard_event_mac.mm

+1-16
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,8 @@ size_t WebKeyboardEventTextLength(const char16_t* text) {
9797
[os_event eventRef];
9898
}
9999

100-
// static
101-
NativeWebKeyboardEvent NativeWebKeyboardEvent::CreateForRenderer(
102-
gfx::NativeEvent native_event) {
103-
return NativeWebKeyboardEvent(native_event, true);
104-
}
105-
106-
NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event,
107-
bool record_debug_uma)
108-
: WebKeyboardEvent(
109-
WebKeyboardEventBuilder::Build(native_event, record_debug_uma)),
110-
os_event([native_event retain]),
111-
skip_in_browser(false) {}
112-
113100
NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
114-
: WebKeyboardEvent(
115-
WebKeyboardEventBuilder::Build(native_event,
116-
/*record_debug_uma=*/false)),
101+
: WebKeyboardEvent(WebKeyboardEventBuilder::Build(native_event)),
117102
os_event([native_event retain]),
118103
skip_in_browser(false) {}
119104

content/public/browser/native_web_keyboard_event.h

-11
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,6 @@ struct CONTENT_EXPORT NativeWebKeyboardEvent : public blink::WebKeyboardEvent {
5454
#endif
5555
#endif
5656

57-
#if BUILDFLAG(IS_MAC)
58-
// TODO(bokan): Temporarily added to debug https://crbug.com/1039833. This is
59-
// used to allow collecting Event.Latency.OS_NO_VALIDATION only in contexts
60-
// where the key event will be sent to the renderer. The purpose is to avoid
61-
// recording it for reinjected events after the renderer has already
62-
// processed the event.
63-
static NativeWebKeyboardEvent CreateForRenderer(
64-
gfx::NativeEvent native_event);
65-
NativeWebKeyboardEvent(gfx::NativeEvent native_event, bool record_debug_uma);
66-
#endif
67-
6857
NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event);
6958
~NativeWebKeyboardEvent() override;
7059

tools/metrics/histograms/metadata/event/histograms.xml

-14
Original file line numberDiff line numberDiff line change
@@ -396,20 +396,6 @@ [email protected].
396396
</summary>
397397
</histogram>
398398

399-
<histogram name="Event.Latency.OS_NO_VALIDATION.POSITIVE" units="ms"
400-
expires_after="2021-08-09">
401-
<owner>[email protected]</owner>
402-
<owner>[email protected]</owner>
403-
<summary>
404-
For Mac, a version of Event.Latency.OS that has the positive values it would
405-
contain if ValidateEventTimeClock() were not called on the timestamps.
406-
407-
This metric is intended to debug http://crbug.com/1039833 where very high
408-
numbers are seen for PageLoad.InputDelay3. The units of this metric are the
409-
same as PageLoad.InputDelay3 for consistency while debugging.
410-
</summary>
411-
</histogram>
412-
413399
<histogram name="Event.Latency.Scroll.Wheel.TimeToHandled2"
414400
units="microseconds" expires_after="2021-12-19">
415401
<owner>[email protected]</owner>

tools/metrics/histograms/metadata/histogram_suffixes_list.xml

-2
Original file line numberDiff line numberDiff line change
@@ -2740,8 +2740,6 @@ [email protected].
27402740
<suffix name="TOUCH_RELEASED" label=""/>
27412741
<affected-histogram name="Event.Latency.OS"/>
27422742
<affected-histogram name="Event.Latency.OS2"/>
2743-
<affected-histogram name="Event.Latency.OS_NO_VALIDATION.NEGATIVE"/>
2744-
<affected-histogram name="Event.Latency.OS_NO_VALIDATION.POSITIVE"/>
27452743
</histogram_suffixes>
27462744

27472745
<histogram_suffixes name="ExtensionsDatabaseRestore" separator=".">

0 commit comments

Comments
 (0)