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

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

Issue 2789683002: Speed up SimpleCache eviction set computation (Closed)
Patch Set: Apply review feedback. 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
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..b4926e51825ccc91e120485a3e5f219c4083896a 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,10 @@ class NET_EXPORT_PRIVATE SimpleIndex
const EntryMetadata& entry_metadata,
EntrySet* entry_set);
+ // For use in tests only.
+ 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);

Powered by Google App Engine
This is Rietveld 408576698