simple_backend_version.h 1.2 KB

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