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

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

Issue 1977863003: SimpleCache: open with fewer seeks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@open-speeder-macbetter
Patch Set: actually fix test Created 4 years, 7 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/simple/simple_test_util.cc ('k') | net/disk_cache/simple/simple_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_util.h
diff --git a/net/disk_cache/simple/simple_util.h b/net/disk_cache/simple/simple_util.h
index faf36b6a90c25fdd89434eca04a07f22b06f3388..aa3eb036ff0682be11c188f4ca74f31d29a68b5c 100644
--- a/net/disk_cache/simple/simple_util.h
+++ b/net/disk_cache/simple/simple_util.h
@@ -53,15 +53,19 @@ std::string GetFilenameFromEntryHashAndFileIndex(uint64_t entry_hash,
// Given a |key| for an entry, returns the name of the sparse data file.
std::string GetSparseFilenameFromEntryHash(uint64_t entry_hash);
+// Given the size of a key, the size in bytes of the header at the beginning
+// of a simple cache file.
+size_t GetHeaderSize(size_t key_length);
+
// Given the size of a file holding a stream in the simple backend and the key
// to an entry, returns the number of bytes in the stream.
-NET_EXPORT_PRIVATE int32_t GetDataSizeFromKeyAndFileSize(const std::string& key,
- int64_t file_size);
+NET_EXPORT_PRIVATE int32_t GetDataSizeFromFileSize(size_t key_length,
+ int64_t file_size);
// Given the size of a stream in the simple backend and the key to an entry,
// returns the number of bytes in the file.
-NET_EXPORT_PRIVATE int64_t GetFileSizeFromKeyAndDataSize(const std::string& key,
- int32_t data_size);
+NET_EXPORT_PRIVATE int64_t GetFileSizeFromDataSize(size_t key_length,
+ int32_t data_size);
// Given the stream index, returns the number of the file the stream is stored
// in.
« no previous file with comments | « net/disk_cache/simple/simple_test_util.cc ('k') | net/disk_cache/simple/simple_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698