| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 SimpleIndexLoadResult(); | 33 SimpleIndexLoadResult(); |
| 34 ~SimpleIndexLoadResult(); | 34 ~SimpleIndexLoadResult(); |
| 35 void Reset(); | 35 void Reset(); |
| 36 | 36 |
| 37 bool did_load; | 37 bool did_load; |
| 38 SimpleIndex::EntrySet entries; | 38 SimpleIndex::EntrySet entries; |
| 39 bool flush_required; | 39 bool flush_required; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // Simple Index File format is a pickle serialized data of IndexMetadata and | 42 // Simple Index File format is a pickle serialized data of IndexMetadata and |
| 43 // EntryMetadata objects. The file format is as follows: one instance of | 43 // EntryMetadata objects. The file format is as follows: one instance of |
| 44 // serialized |IndexMetadata| followed serialized |EntryMetadata| entries | 44 // serialized |IndexMetadata| followed serialized |EntryMetadata| entries |
| 45 // repeated |number_of_entries| amount of times. To know more about the format, | 45 // repeated |number_of_entries| amount of times. To know more about the format, |
| 46 // see SimpleIndexFile::Serialize() and SeeSimpleIndexFile::LoadFromDisk() | 46 // see SimpleIndexFile::Serialize() and SeeSimpleIndexFile::LoadFromDisk() |
| 47 // methods. | 47 // methods. |
| 48 // | 48 // |
| 49 // The non-static methods must run on the IO thread. All the real | 49 // The non-static methods must run on the IO thread. All the real |
| 50 // work is done in the static methods, which are run on the cache thread | 50 // work is done in the static methods, which are run on the cache thread |
| 51 // or in worker threads. Synchronization between methods is the | 51 // or in worker threads. Synchronization between methods is the |
| 52 // responsibility of the caller. | 52 // responsibility of the caller. |
| 53 class NET_EXPORT_PRIVATE SimpleIndexFile { | 53 class NET_EXPORT_PRIVATE SimpleIndexFile { |
| 54 public: | 54 public: |
| 55 class NET_EXPORT_PRIVATE IndexMetadata { | 55 class NET_EXPORT_PRIVATE IndexMetadata { |
| 56 public: | 56 public: |
| 57 IndexMetadata(); | 57 IndexMetadata(); |
| 58 IndexMetadata(uint64 number_of_entries, uint64 cache_size); | 58 IndexMetadata(uint64 number_of_entries, uint64 cache_size); |
| 59 | 59 |
| 60 void Serialize(Pickle* pickle) const; | 60 void Serialize(Pickle* pickle) const; |
| 61 bool Deserialize(PickleIterator* it); | 61 bool Deserialize(PickleIterator* it); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 static const char kIndexFileName[]; | 179 static const char kIndexFileName[]; |
| 180 static const char kTempIndexFileName[]; | 180 static const char kTempIndexFileName[]; |
| 181 | 181 |
| 182 DISALLOW_COPY_AND_ASSIGN(SimpleIndexFile); | 182 DISALLOW_COPY_AND_ASSIGN(SimpleIndexFile); |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 | 185 |
| 186 } // namespace disk_cache | 186 } // namespace disk_cache |
| 187 | 187 |
| 188 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ | 188 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ |
| OLD | NEW |