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_INDEX_FILE_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ |
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 uint64_t entry_count, | 60 uint64_t entry_count, |
61 uint64_t cache_size); | 61 uint64_t cache_size); |
62 | 62 |
63 virtual void Serialize(base::Pickle* pickle) const; | 63 virtual void Serialize(base::Pickle* pickle) const; |
64 bool Deserialize(base::PickleIterator* it); | 64 bool Deserialize(base::PickleIterator* it); |
65 | 65 |
66 bool CheckIndexMetadata(); | 66 bool CheckIndexMetadata(); |
67 | 67 |
68 SimpleIndex::IndexWriteToDiskReason reason() const { return reason_; } | 68 SimpleIndex::IndexWriteToDiskReason reason() const { return reason_; } |
69 uint64_t entry_count() const { return entry_count_; } | 69 uint64_t entry_count() const { return entry_count_; } |
| 70 bool has_memory_entry_data() const { return version_ >= 8; } |
70 | 71 |
71 private: | 72 private: |
72 FRIEND_TEST_ALL_PREFIXES(IndexMetadataTest, Basics); | 73 FRIEND_TEST_ALL_PREFIXES(IndexMetadataTest, Basics); |
73 FRIEND_TEST_ALL_PREFIXES(IndexMetadataTest, Serialize); | 74 FRIEND_TEST_ALL_PREFIXES(IndexMetadataTest, Serialize); |
74 FRIEND_TEST_ALL_PREFIXES(IndexMetadataTest, ReadV6Format); | 75 FRIEND_TEST_ALL_PREFIXES(IndexMetadataTest, ReadV6Format); |
75 friend class V6IndexMetadataForTest; | 76 friend class V6IndexMetadataForTest; |
76 | 77 |
77 uint64_t magic_number_; | 78 uint64_t magic_number_; |
78 uint32_t version_; | 79 uint32_t version_; |
79 SimpleIndex::IndexWriteToDiskReason reason_; | 80 SimpleIndex::IndexWriteToDiskReason reason_; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 static const char kIndexFileName[]; | 195 static const char kIndexFileName[]; |
195 static const char kTempIndexFileName[]; | 196 static const char kTempIndexFileName[]; |
196 | 197 |
197 DISALLOW_COPY_AND_ASSIGN(SimpleIndexFile); | 198 DISALLOW_COPY_AND_ASSIGN(SimpleIndexFile); |
198 }; | 199 }; |
199 | 200 |
200 | 201 |
201 } // namespace disk_cache | 202 } // namespace disk_cache |
202 | 203 |
203 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ | 204 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ |
OLD | NEW |