Commit 5cb23de2 authored by Xinghui Lu's avatar Xinghui Lu Committed by Commit Bot

Shutdown services in services_delegate base class.

password_protection_service and cache_manager were moved to
services_delegate base class, but they are not shutdown explicitly in
services_delegate_android.

In this CL, move them to be shutdown in the base class, and let the
derived classes call the base class method.

Bug: 1050084
Change-Id: I30a70bb05432aa820073520b3fedfba694064be4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050746Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740509}
parent 20ce1e1c
......@@ -66,6 +66,7 @@ void ServicesDelegateAndroid::SetDatabaseManagerForTest(
void ServicesDelegateAndroid::ShutdownServices() {
telemetry_service_.reset();
ServicesDelegate::ShutdownServices();
}
void ServicesDelegateAndroid::RefreshState(bool enable) {}
......
......@@ -90,4 +90,12 @@ VerdictCacheManager* ServicesDelegate::GetVerdictCacheManager(
return it->second.get();
}
void ServicesDelegate::ShutdownServices() {
// Delete the VerdictCacheManager instances
cache_manager_map_.clear();
// Delete the ChromePasswordProtectionService instances.
password_protection_service_map_.clear();
}
} // namespace safe_browsing
......@@ -99,7 +99,7 @@ class ServicesDelegate {
SafeBrowsingDatabaseManager* database_manager) = 0;
// Shuts down the download service.
virtual void ShutdownServices() = 0;
virtual void ShutdownServices();
// Handles SafeBrowsingService::RefreshState() for the provided services.
virtual void RefreshState(bool enable) = 0;
......
......@@ -117,15 +117,11 @@ void ServicesDelegateDesktop::ShutdownServices() {
resource_request_detector_.reset();
incident_service_.reset();
// Delete the VerdictCacheManager instances
cache_manager_map_.clear();
// Delete the ChromePasswordProtectionService instances.
password_protection_service_map_.clear();
// Delete the BinaryUploadService instances.
binary_upload_service_map_.clear();
ServicesDelegate::ShutdownServices();
// Must shut down last.
download_service_.reset();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment