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

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

Issue 23983005: SimpleCache: merge the first and second stream in one file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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_util.h
diff --git a/net/disk_cache/simple/simple_util.h b/net/disk_cache/simple/simple_util.h
index 3bb80b9540238393aa859a9791e6a4faab7d458f..ef7119b70960d4ee6e4f6ea525d25cdd3b2ff6a2 100644
--- a/net/disk_cache/simple/simple_util.h
+++ b/net/disk_cache/simple/simple_util.h
@@ -56,12 +56,21 @@ NET_EXPORT_PRIVATE int32 GetDataSizeFromKeyAndFileSize(const std::string& key,
// returns the number of bytes in the file.
NET_EXPORT_PRIVATE int64 GetFileSizeFromKeyAndDataSize(const std::string& key,
int32 data_size);
+// Given the stream index, returns the number of the file the stream is stored
+// in.
+NET_EXPORT_PRIVATE int GetFileIndexFromStreamIndex(int stream_index);
+
+// Given the data size for all streams and a file index, gives the data maximum
+// offset.
+NET_EXPORT_PRIVATE int GetMaximumDataOffset(int file_index,
+ const int data_size[]);
// Given the key to an entry, and an offset into a stream on that entry, returns
// the file offset corresponding to |data_offset|.
-NET_EXPORT_PRIVATE int64 GetFileOffsetFromKeyAndDataOffset(
- const std::string& key,
- int data_offset);
+NET_EXPORT_PRIVATE int64 GetFileOffsetFromDataOffset(const std::string& key,
+ int data_offset,
+ int index,
+ int stream_1_size);
// Fills |out_time| with the time the file last modified time.
// TODO(gavinp): Remove this function.

Powered by Google App Engine
This is Rietveld 408576698