Files
nearby/internal/platform/implementation
Ryan Hansberry cc84b6f4a4 Make credential refill asynchronous
Fixes a ChromeOS-deadlock during credential refill. The
previous logic blocked the IO thread that ChromeOS is using
to listen for responses from its CredentialStorage layer,
thus preventing it from signaling the latch.

Given that CheckCredentialsAndRefillIfNeeded is meant to
be async (given its continuation-passing style), this CL
avoids any thread trickiness by removing any latch-waiting
within the function. The nice side-effect of this is breaking
up the function into 3 smaller functions, which should
hopefully make it a bit more readable.

//.../g3/credential_storage_impl.cc has its mutex locks
removed -- they otherwise cause deadlocks, and are now
unnecessary.

This CL introduces a CHECK_EQ to ensure that the number of
remaining valid (not-expired) credentials is equal across the
shared and local list. This actually exposed a bug in the
credential_manager_impl_test.cc -- the test was only expiring
a public credential, and not its corresponding private credential.
Thus, the test is also updated in this CL to correctly mark
the first credential of the shared and local list as expired.

PiperOrigin-RevId: 631822135
2024-05-08 09:14:53 -07:00
..
2024-05-08 09:14:53 -07:00
2024-03-31 16:16:32 -07:00
2024-04-22 22:39:50 -07:00
2024-04-08 17:56:34 -07:00
2024-03-18 13:22:56 -07:00