Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Unified Diff: net/disk_cache/simple/simple_index.h

Issue 2789683002: Speed up SimpleCache eviction set computation (Closed)
Patch Set: git cl try Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/disk_cache_perftest.cc ('k') | net/disk_cache/simple/simple_index.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_index.h
diff --git a/net/disk_cache/simple/simple_index.h b/net/disk_cache/simple/simple_index.h
index 7758d91362ab14882989e9ee19e05628fe108d53..2fd3e1fa598645c21705413f70eec397bae6d41b 100644
--- a/net/disk_cache/simple/simple_index.h
+++ b/net/disk_cache/simple/simple_index.h
@@ -51,6 +51,10 @@ class NET_EXPORT_PRIVATE EntryMetadata {
base::Time GetLastUsedTime() const;
void SetLastUsedTime(const base::Time& last_used_time);
+ uint32_t RawTimeForSorting() const {
+ return last_used_time_seconds_since_epoch_;
+ }
+
uint32_t GetEntrySize() const;
void SetEntrySize(base::StrictNumeric<uint32_t> entry_size);
@@ -135,6 +139,11 @@ class NET_EXPORT_PRIVATE SimpleIndex
const EntryMetadata& entry_metadata,
EntrySet* entry_set);
+ // For use in tests only. Updates cache_size_, but will not start evictions
+ // or adjust index writing time. Requires entry to not already be in the set.
+ void InsertEntryForTesting(uint64_t entry_hash,
+ const EntryMetadata& entry_metadata);
+
// Executes the |callback| when the index is ready. Allows multiple callbacks.
int ExecuteWhenReady(const net::CompletionCallback& callback);
« no previous file with comments | « net/disk_cache/disk_cache_perftest.cc ('k') | net/disk_cache/simple/simple_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698