Skip to content
Commit edf91e7b authored by cassycc's avatar cassycc Committed by Chromium LUCI CQ
Browse files

[FspCache] Uninitialize provider upon user unmount

CL:5409956 introduced CacheManager::UninitializeForProvider(). Let
Service::UnmountFileSystem() be the caller of that.

When the UnmountReason reason is UNMOUNT_REASON_USER, the file system
(with the same mount path) will never be used again and thus, the
content cache will never be used again.

Thus, when the reason is UNMOUNT_REASON_USER, uninitialize the provider
from the CacheManager if it was initialized. Introduce
CacheManager::IsProviderInitialized() to do the pre-condition
check.

Do not uninitialize if the reason is UNMOUNT_REASON_SHUTDOWN because
the provider will be restored upon start up.

Test: browser_tests --gtest_filter=CloudFileSystemBrowserTestWithContentCache*
Bug: b/330812469
Change-Id: I474f2fa5a988e7b7d930d9f634f6fefc99a85477
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5417754


Reviewed-by: default avatarBen Reich <benreich@chromium.org>
Commit-Queue: Cassy Chun-Crogan <cassycc@google.com>
Cr-Commit-Position: refs/heads/main@{#1282324}
parent dea2257c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment