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

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: Stream 0 size in footer 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 ef518695813cff891658644aa2a831da35c3b1a8..3c3bd3600f06ec0c35a1264585387c13b19b554e 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 offset of the
+// last EOF record.
+NET_EXPORT_PRIVATE int GetLastEOFRecordOffset(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);
pasko 2013/09/17 11:29:01 Originally I did not like this stream_1_size in th
clamy 2013/09/17 13:59:42 Done.
// Fills |out_time| with the time the file last modified time. Unlike the
// functions in platform_file.h, the time resolution is milliseconds.

Powered by Google App Engine
This is Rietveld 408576698