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:

committed by
Chromium LUCI CQ

parent
6ac3a31add
commit
8fdc224330
base
cc
paint
tiles
trees
chrome
browser
bitmap_fetcher
lite_video
media
optimization_guide
subresource_redirect
ui
views
renderer
chromecast/crypto
components
autofill
core
browser
autofill_assistant
dom_distiller
favicon
history
core
browser
nacl
omnibox
optimization_guide
password_manager
core
safe_search_api
security_interstitials
services
storage
indexed_db
transactional_leveldb
gpu/command_buffer/service
gr_shader_cache.hmemory_program_cache.ccmemory_program_cache.hpassthrough_discardable_manager.hpassthrough_program_cache.ccpassthrough_program_cache.hservice_discardable_manager.hservice_transfer_cache.hshared_context_state.h
ios
chrome
browser
web
security
media
gpu
ipc
service
test
v4l2
vaapi
mojo
clients
net
cert
http
broken_alternative_services.ccbroken_alternative_services.hhttp_server_properties.cchttp_server_properties.h
quic
reporting
socket
ssl
services
cert_verifier
network
sct_auditing
storage/browser/blob
third_party/blink
renderer
tools
blinkpy
presubmit
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};
|
||||
|
Reference in New Issue
Block a user