0

Rename MRUCache to LRUCache.

https://en.wikipedia.org/wiki/Cache_replacement_policies indicates that
this implementation is actually an LRU cache, not an MRU cache. An MRU
cache evicts the most-recently-used item first.

This CL also renames some variables and an enum for consistency, since
it would be weird for an `mru_cache_` member to actually be an LRU
cache.

Change-Id: Ia52d7dbf18785620466d99d362633fe7ecf7fb41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3214453
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931363}
This commit is contained in:
cfredric
2021-10-14 03:24:00 +00:00
committed by Chromium LUCI CQ
parent 6ac3a31add
commit 8fdc224330
89 changed files with 277 additions and 279 deletions
base
cc
chrome
chromecast/crypto
components
gpu/command_buffer/service
ios
media
net
services
storage/browser/blob
third_party/blink
ui

@ -9,7 +9,7 @@
#include <memory>
#include "base/callback_forward.h"
#include "base/containers/mru_cache.h"
#include "base/containers/lru_cache.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "components/safe_search_api/url_checker_client.h"
@ -72,7 +72,7 @@ class URLChecker {
std::unique_ptr<URLCheckerClient> async_checker_;
CheckList checks_in_progress_;
base::MRUCache<GURL, CheckResult> cache_;
base::LRUCache<GURL, CheckResult> cache_;
base::TimeDelta cache_timeout_;
base::WeakPtrFactory<URLChecker> weak_factory_{this};