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

Side by Side Diff: webkit/fileapi/file_system_usage_cache.h

Issue 9910005: Add database recovery for FileSystemDirectoryDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 10
(...skipping 24 matching lines...) Expand all
35 static int UpdateUsage(const FilePath& usage_file_path, int64 fs_usage); 35 static int UpdateUsage(const FilePath& usage_file_path, int64 fs_usage);
36 36
37 // Updates the size described in the .usage file by delta with keeping dirty 37 // Updates the size described in the .usage file by delta with keeping dirty
38 // even if dirty > 0. 38 // even if dirty > 0.
39 static int AtomicUpdateUsageByDelta( 39 static int AtomicUpdateUsageByDelta(
40 const FilePath& usage_file_path, int64 delta); 40 const FilePath& usage_file_path, int64 delta);
41 41
42 static bool Exists(const FilePath& usage_file_path); 42 static bool Exists(const FilePath& usage_file_path);
43 static bool Delete(const FilePath& usage_file_path); 43 static bool Delete(const FilePath& usage_file_path);
44 44
45 static const char kUsageFileName[]; 45 static const FilePath::CharType kUsageFileName[];
46 static const char kUsageFileHeader[]; 46 static const char kUsageFileHeader[];
47 static const int kUsageFileSize; 47 static const int kUsageFileSize;
48 static const int kUsageFileHeaderSize; 48 static const int kUsageFileHeaderSize;
49 49
50 private: 50 private:
51 // Read the size, validity and the "dirty" entry described in the .usage file. 51 // Read the size, validity and the "dirty" entry described in the .usage file.
52 // Returns less than zero if no .usage file is available. 52 // Returns less than zero if no .usage file is available.
53 static int64 Read(const FilePath& usage_file_path, 53 static int64 Read(const FilePath& usage_file_path,
54 bool* is_valid, 54 bool* is_valid,
55 uint32* dirty); 55 uint32* dirty);
56 56
57 static int Write(const FilePath& usage_file_path, 57 static int Write(const FilePath& usage_file_path,
58 bool is_valid, 58 bool is_valid,
59 uint32 dirty, 59 uint32 dirty,
60 int64 fs_usage); 60 int64 fs_usage);
61 }; 61 };
62 62
63 } // namespace fileapi 63 } // namespace fileapi
64 64
65 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ 65 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_origin_database_unittest.cc ('k') | webkit/fileapi/file_system_usage_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698