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 #include "net/disk_cache/simple/simple_version_upgrade.h" | 5 #include "net/disk_cache/simple/simple_version_upgrade.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/files/memory_mapped_file.h" | 11 #include "base/files/memory_mapped_file.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/pickle.h" | 13 #include "base/pickle.h" |
| 14 #include "base/platform_file.h" |
14 #include "net/disk_cache/simple/simple_backend_version.h" | 15 #include "net/disk_cache/simple/simple_backend_version.h" |
15 #include "net/disk_cache/simple/simple_entry_format_history.h" | 16 #include "net/disk_cache/simple/simple_entry_format_history.h" |
16 #include "third_party/zlib/zlib.h" | 17 #include "third_party/zlib/zlib.h" |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
20 // It is not possible to upgrade cache structures on disk that are of version | 21 // It is not possible to upgrade cache structures on disk that are of version |
21 // below this, the entire cache should be dropped for them. | 22 // below this, the entire cache should be dropped for them. |
22 const uint32 kMinVersionAbleToUpgrade = 5; | 23 const uint32 kMinVersionAbleToUpgrade = 5; |
23 | 24 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 195 } |
195 } | 196 } |
196 // Verify during the test stage that the upgraders are implemented for all | 197 // Verify during the test stage that the upgraders are implemented for all |
197 // versions. The release build would cause backend initialization failure | 198 // versions. The release build would cause backend initialization failure |
198 // which would then later lead to removing all files known to the backend. | 199 // which would then later lead to removing all files known to the backend. |
199 DCHECK_EQ(kSimpleVersion, version_from); | 200 DCHECK_EQ(kSimpleVersion, version_from); |
200 return false; | 201 return false; |
201 } | 202 } |
202 | 203 |
203 } // namespace disk_cache | 204 } // namespace disk_cache |
OLD | NEW |