OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_DISK_FORMAT_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_DISK_FORMAT_H_ |
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_DISK_FORMAT_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_DISK_FORMAT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // ------------------------- | 46 // ------------------------- |
47 // Repeated |size| times { | 47 // Repeated |size| times { |
48 // struct EntryMetadata; | 48 // struct EntryMetadata; |
49 // } | 49 // } |
50 // ------------------------- | 50 // ------------------------- |
51 // struct Footer; | 51 // struct Footer; |
52 // ------------------------- | 52 // ------------------------- |
53 namespace SimpleIndexFile { | 53 namespace SimpleIndexFile { |
54 // Simple Index File metadata is defined here. | 54 // Simple Index File metadata is defined here. |
55 struct Header { | 55 struct Header { |
| 56 Header(); |
56 uint64 initial_magic_number; | 57 uint64 initial_magic_number; |
57 uint32 version; | 58 uint32 version; |
58 uint64 number_of_entries; | 59 uint64 number_of_entries; |
59 uint64 cache_size; // Total cache storage size in bytes. | 60 uint64 cache_size; // Total cache storage size in bytes. |
60 }; | 61 }; |
61 | 62 |
62 // We must keep this struct a POD. | 63 // We must keep this struct a POD. |
63 struct EntryMetadata { | 64 struct EntryMetadata { |
64 EntryMetadata(); | 65 EntryMetadata(); |
65 EntryMetadata(const std::string& hash_key_p, | 66 EntryMetadata(const std::string& hash_key_p, |
(...skipping 16 matching lines...) Expand all Loading... |
82 // If you want to make calculations/comparisons, you should use the | 83 // If you want to make calculations/comparisons, you should use the |
83 // base::Time() class. Use the GetLastUsedTime() method above. | 84 // base::Time() class. Use the GetLastUsedTime() method above. |
84 int64 last_used_time; | 85 int64 last_used_time; |
85 | 86 |
86 uint64 entry_size; // Storage size in bytes. | 87 uint64 entry_size; // Storage size in bytes. |
87 }; | 88 }; |
88 | 89 |
89 const size_t kEntryMetadataSize = sizeof(EntryMetadata); | 90 const size_t kEntryMetadataSize = sizeof(EntryMetadata); |
90 | 91 |
91 struct Footer { | 92 struct Footer { |
| 93 Footer(); |
92 uint32 crc; | 94 uint32 crc; |
93 }; | 95 }; |
94 | 96 |
95 } // namespace SimpleIndexFile | 97 } // namespace SimpleIndexFile |
96 | 98 |
97 } // namespace disk_cache | 99 } // namespace disk_cache |
98 | 100 |
99 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_DISK_FORMAT_H_ | 101 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_DISK_FORMAT_H_ |
OLD | NEW |