0

[ios blink] Initialize the local time before entering sandbox

localtime_r fails if its first call is after the sandbox is
initialized. Ensure we call it before entering the sandbox.

Bug: 40254930
Change-Id: Ic2c5abf21d9e3a9593171c2de70c718d075ca779
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6312885
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1427130}
This commit is contained in:
Dave Tapuska
2025-03-03 07:48:08 -08:00
committed by Chromium LUCI CQ
parent b05a3797eb
commit ca77d58a51

@ -114,6 +114,11 @@ namespace content {
void ChildProcessEnterSandbox() {
base::SysInfo::IsLowEndDevice();
// Request the local time before entering the sandbox since that causes a
// crash after the sandbox is entered.
base::Time::Now().LocalMidnight();
[g_swift_process applySandbox];
}