OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_BACKEND_VERSION_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_VERSION_H_ |
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_VERSION_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_VERSION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 namespace disk_cache { | 10 namespace disk_cache { |
11 | 11 |
12 // Short rules helping to think about data upgrades within Simple Cache: | 12 // Short rules helping to think about data upgrades within Simple Cache: |
13 // * ALL changes of on-disk data format, backward-compatible or not, | 13 // * ALL changes of on-disk data format, backward-compatible or not, |
14 // forward-compatible or not, require updating the |kSimpleVersion|. | 14 // forward-compatible or not, require updating the |kSimpleVersion|. |
15 // * All cache Upgrades are performed on backend start, must be finished | 15 // * All cache Upgrades are performed on backend start, must be finished |
16 // before the new backend starts processing any incoming operations. | 16 // before the new backend starts processing any incoming operations. |
17 // * If the Upgrade is not implemented for transition from | 17 // * If the Upgrade is not implemented for transition from |
18 // |kSimpleVersion - 1| then the whole cache directory will be cleared. | 18 // |kSimpleVersion - 1| then the whole cache directory will be cleared. |
19 // * Dropping cache data on disk or some of its parts can be a valid way to | 19 // * Dropping cache data on disk or some of its parts can be a valid way to |
20 // Upgrade. | 20 // Upgrade. |
21 const uint32_t kSimpleVersion = 7; | 21 const uint32_t kLastCompatSparseVersion = 7; |
| 22 const uint32_t kSimpleVersion = 8; |
22 | 23 |
23 // The version of the entry file(s) as written to disk. Must be updated iff the | 24 // The version of the entry file(s) as written to disk. Must be updated iff the |
24 // entry format changes with the overall backend version update. | 25 // entry format changes with the overall backend version update. |
25 const uint32_t kSimpleEntryVersionOnDisk = 5; | 26 const uint32_t kSimpleEntryVersionOnDisk = 5; |
26 | 27 |
27 } // namespace disk_cache | 28 } // namespace disk_cache |
28 | 29 |
29 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_VERSION_H_ | 30 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_VERSION_H_ |
OLD | NEW |