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

Side by Side Diff: storage/browser/fileapi/sandbox_directory_database.h

Issue 602043002: FileSystem: Make SandboxDirectoryDatabase::DestroyDatabase non-static for cleanup (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: remake Created 6 years, 2 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 STORAGE_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_ 5 #ifndef STORAGE_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_
6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_ 6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // This produces the series 0, 1, 2..., starting at 0 when the underlying 92 // This produces the series 0, 1, 2..., starting at 0 when the underlying
93 // filesystem is first created, and maintaining state across 93 // filesystem is first created, and maintaining state across
94 // creation/destruction of SandboxDirectoryDatabase objects. 94 // creation/destruction of SandboxDirectoryDatabase objects.
95 bool GetNextInteger(int64* next); 95 bool GetNextInteger(int64* next);
96 96
97 bool IsDirectory(FileId file_id); 97 bool IsDirectory(FileId file_id);
98 98
99 // Returns true if the database looks consistent with local filesystem. 99 // Returns true if the database looks consistent with local filesystem.
100 bool IsFileSystemConsistent(); 100 bool IsFileSystemConsistent();
101 101
102 static bool DestroyDatabase(const base::FilePath& path, 102 // Completely deletes contents of the database.
103 leveldb::Env* env_override); 103 bool DestroyDatabase();
104 104
105 private: 105 private:
106 enum RecoveryOption { 106 enum RecoveryOption {
107 DELETE_ON_CORRUPTION, 107 DELETE_ON_CORRUPTION,
108 REPAIR_ON_CORRUPTION, 108 REPAIR_ON_CORRUPTION,
109 FAIL_ON_CORRUPTION, 109 FAIL_ON_CORRUPTION,
110 }; 110 };
111 111
112 friend class content::SandboxDirectoryDatabaseTest; 112 friend class content::SandboxDirectoryDatabaseTest;
113 friend class ObfuscatedFileUtil; 113 friend class ObfuscatedFileUtil;
(...skipping 12 matching lines...) Expand all
126 const base::FilePath filesystem_data_directory_; 126 const base::FilePath filesystem_data_directory_;
127 leveldb::Env* env_override_; 127 leveldb::Env* env_override_;
128 scoped_ptr<leveldb::DB> db_; 128 scoped_ptr<leveldb::DB> db_;
129 base::Time last_reported_time_; 129 base::Time last_reported_time_;
130 DISALLOW_COPY_AND_ASSIGN(SandboxDirectoryDatabase); 130 DISALLOW_COPY_AND_ASSIGN(SandboxDirectoryDatabase);
131 }; 131 };
132 132
133 } // namespace storage 133 } // namespace storage
134 134
135 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_ 135 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_
OLDNEW
« no previous file with comments | « storage/browser/fileapi/obfuscated_file_util.cc ('k') | storage/browser/fileapi/sandbox_directory_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698