Skip to content

Commit 59e89f9

Browse files
author
徐扬斌
committed
MacOSX: Change the two dummy messages to use systemUpTime as timestamp to fix CEF renderer process crash.
Begin with Chromium 97, EventLatencyTracingRecorder was added to trace the performance. And the timestamp 0 used will lead to 'DCHECK(!dispatch_timestamp.is_null());' in function EventLatencyTracingRecorder::RecordEventLatencyTraceEvent see: https://github.com/chromium/chromium/blob/109.0.5414.120/cc/metrics/event_latency_tracing_recorder.cc Way to reproduce the crash: Right click to popup the context-menu created by CEF. Then the CEF renderer process will crash. Set the timestamp to [[NSProcessInfo processInfo] systemUptime] to fix it.
1 parent cd69ca2 commit 59e89f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/osx/cocoa/evtloop.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static NSUInteger CalculateNSEventMaskFromEventCategory(wxEventCategory cat)
380380
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
381381
location:NSMakePoint(0.0, 0.0)
382382
modifierFlags:0
383-
timestamp:0
383+
timestamp:[[NSProcessInfo processInfo] systemUptime]
384384
windowNumber:0
385385
context:nil
386386
subtype:0 data1:0 data2:0];

src/osx/cocoa/utils.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ - (void)sendEvent:(NSEvent *)anEvent
409409
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
410410
location:NSMakePoint(0.0, 0.0)
411411
modifierFlags:0
412-
timestamp:0
412+
timestamp:[[NSProcessInfo processInfo] systemUptime]
413413
windowNumber:0
414414
context:nil
415415
subtype:0 data1:0 data2:0];

0 commit comments

Comments
 (0)