Commit 8f06b391 authored by Chong Zhang's avatar Chong Zhang Committed by Commit Bot

NetworkService: Don't call StoragePartition::ClearHttpAndMediaCaches

We've deprecated the concept of a media cache, and are now using a
single cache for both purposes.

|NetworkContext::ClearHttpCache()| does the job to clear the cache when
Network Service was enabled, and we should only call
|StoragePartition::ClearHttpAndMediaCaches()| when Network Service was
disabled.

Bug: 877639
Change-Id: Id227322b9b2d64b76a53a45147010227b620468f
Reviewed-on: https://chromium-review.googlesource.com/1187571
Commit-Queue: Chong Zhang <chongz@chromium.org>
Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586440}
parent 67e51fc8
......@@ -419,23 +419,23 @@ void BrowsingDataRemoverImpl::RemoveImpl(
// TODO(msramek): Clear the cache of all renderers.
// TODO(crbug.com/813882): implement retry on network service.
if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
// The clearing of the HTTP cache happens in the network service process
// when enabled.
// when enabled. Note that we've deprecated the concept of a media cache,
// and are now using a single cache for both purposes.
network_context->ClearHttpCache(
delete_begin, delete_end, filter_builder.BuildNetworkServiceFilter(),
CreatePendingTaskCompletionClosureForMojo());
} else {
storage_partition->ClearHttpAndMediaCaches(
delete_begin, delete_end,
filter_builder.IsEmptyBlacklist()
? base::Callback<bool(const GURL&)>()
: std::move(filter),
CreatePendingTaskCompletionClosureForMojo());
}
// In the network service case, the call below will only clear the media
// cache.
// TODO(crbug.com/813882): implement retry on network service.
storage_partition->ClearHttpAndMediaCaches(
delete_begin, delete_end,
filter_builder.IsEmptyBlacklist() ? base::Callback<bool(const GURL&)>()
: std::move(filter),
CreatePendingTaskCompletionClosureForMojo());
// When clearing cache, wipe accumulated network related data
// (TransportSecurityState and HttpServerPropertiesManager data).
network_context->ClearNetworkingHistorySince(
......
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