Commit 2d2bf904 authored by Alex Turner's avatar Alex Turner Committed by Commit Bot

Do not attempt to invalidate cache entries with unpopulated NIKs

If the split cache is enabled, do not attempt to call
DoomMainEntryForUrl if the network_isolation_key (NIK) is unpopulated.
This previously would occur for requests in HttpCacheLookupManager, but
the cache is bypassed for these requests, making the call unnecessary.
When the call was made, a DCHECK was hit in GenerateCacheKey given the
empty NIK.

Bug: 1014077
Change-Id: I566d021d50ea7200d8d99702e382c7db932dfe44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1860312Reviewed-by: default avatarShivani Sharma <shivanisha@chromium.org>
Commit-Queue: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705988}
parent e462fee0
......@@ -1817,9 +1817,14 @@ int HttpCache::Transaction::DoSuccessfulSendRequest() {
DoneWithEntry(true);
}
// Invalidate any cached GET with a successful POST.
// Invalidate any cached GET with a successful POST. If the network isolation
// key isn't populated with the split cache active, there will be nothing to
// invalidate in the cache.
if (!(effective_load_flags_ & LOAD_DISABLE_CACHE) && method_ == "POST" &&
NonErrorResponse(new_response_->headers->response_code())) {
NonErrorResponse(new_response_->headers->response_code()) &&
(!base::FeatureList::IsEnabled(
net::features::kSplitCacheByNetworkIsolationKey) ||
request_->network_isolation_key.IsFullyPopulated())) {
cache_->DoomMainEntryForUrl(request_->url, request_->network_isolation_key);
}
......
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