Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: net/disk_cache/simple/simple_version_upgrade.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_VERSION_UPGRADE_H_
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_VERSION_UPGRADE_H_
7
8 // Defines functionality to upgrade the file structure of the Simple Cache
9 // Backend on disk. Assumes no backend operations are running simultaneously.
10 // Hence must be run at cache initialization step.
11
12 #include "base/basictypes.h"
13 #include "net/base/net_export.h"
14
15 namespace base {
16 class FilePath;
17 }
18
19 namespace disk_cache {
20
21 // Performs all necessary disk IO to upgrade the cache structure if it is
22 // needed.
23 //
24 // Returns true iff no errors were found during consistency checks and all
25 // necessary transitions succeeded. If this function fails, there is nothing
26 // left to do other than dropping the whole cache directory.
27 NET_EXPORT_PRIVATE bool UpgradeSimpleCacheOnDisk(const base::FilePath& path);
28
29 // The format for the fake index has mistakenly acquired two extra fields that
30 // do not contain any useful data. Since they were equal to zero, they are now
31 // mandatated to be zero.
32 struct NET_EXPORT_PRIVATE FakeIndexData {
33 FakeIndexData();
34
35 // Must be equal to simplecache_v4::kSimpleInitialMagicNumber.
36 uint64 initial_magic_number;
37
38 // Must be equal kSimpleVersion when the cache backend is instantiated.
39 uint32 version;
40
41 uint32 unused_must_be_zero1;
42 uint32 unused_must_be_zero2;
43 };
44
45 // Exposed for testing.
46 NET_EXPORT_PRIVATE bool UpgradeIndexV5V6(const base::FilePath& cache_directory);
47
48 } // namespace disk_cache
49
50 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_VERSION_UPGRADE_H_
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_util_win.cc ('k') | net/disk_cache/simple/simple_version_upgrade.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698