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" |
11 #include "base/port.h" | 11 #include "base/port.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class Time; | 14 class Time; |
15 } | 15 } |
16 | 16 |
17 namespace disk_cache { | 17 namespace disk_cache { |
18 | 18 |
19 const uint64 kSimpleInitialMagicNumber = GG_UINT64_C(0xfcfb6d1ba7725c30); | 19 const uint64 kSimpleInitialMagicNumber = GG_UINT64_C(0xfcfb6d1ba7725c30); |
20 const uint64 kSimpleIndexInitialMagicNumber = GG_UINT64_C(0x656e74657220796f); | 20 const uint64 kSimpleIndexInitialMagicNumber = GG_UINT64_C(0x656e74657220796f); |
21 | 21 |
22 // A file in the Simple cache consists of a SimpleFileHeader followed | 22 // A file in the Simple cache consists of a SimpleFileHeader followed |
23 // by data. | 23 // by data. |
24 | 24 |
25 const uint32 kSimpleVersion = 1; | 25 const uint32 kSimpleVersion = 1; |
26 | 26 |
27 static const int kSimpleEntryFileCount = 3; | 27 static const int kSimpleEntryFileCount = 3; |
28 | 28 |
29 struct SimpleFileHeader { | 29 struct SimpleFileHeader { |
| 30 SimpleFileHeader(); |
30 uint64 initial_magic_number; | 31 uint64 initial_magic_number; |
31 uint32 version; | 32 uint32 version; |
32 uint32 key_length; | 33 uint32 key_length; |
33 uint32 key_hash; | 34 uint32 key_hash; |
34 }; | 35 }; |
35 | 36 |
36 // kHashKeySize must conform to the pattern in the GetHashForKey function. | 37 // kHashKeySize must conform to the pattern in the GetHashForKey function. |
37 const int kEntryHashKeySize = 10; | 38 const int kEntryHashKeySize = 10; |
38 std::string GetEntryHashForKey(const std::string& key); | 39 std::string GetEntryHashForKey(const std::string& key); |
39 | 40 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 struct Footer { | 104 struct Footer { |
104 Footer(); | 105 Footer(); |
105 uint32 crc; | 106 uint32 crc; |
106 }; | 107 }; |
107 | 108 |
108 } // namespace SimpleIndexFile | 109 } // namespace SimpleIndexFile |
109 | 110 |
110 } // namespace disk_cache | 111 } // namespace disk_cache |
111 | 112 |
112 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_DISK_FORMAT_H_ | 113 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_DISK_FORMAT_H_ |
OLD | NEW |