OLD | NEW |
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_ORIGIN_DATABASE_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_ |
6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_ | 6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 FAIL_ON_CORRUPTION, | 54 FAIL_ON_CORRUPTION, |
55 }; | 55 }; |
56 | 56 |
57 enum InitOption { | 57 enum InitOption { |
58 CREATE_IF_NONEXISTENT, | 58 CREATE_IF_NONEXISTENT, |
59 FAIL_IF_NONEXISTENT, | 59 FAIL_IF_NONEXISTENT, |
60 }; | 60 }; |
61 | 61 |
62 bool Init(InitOption init_option, RecoveryOption recovery_option); | 62 bool Init(InitOption init_option, RecoveryOption recovery_option); |
63 bool RepairDatabase(const std::string& db_path); | 63 bool RepairDatabase(const std::string& db_path); |
| 64 // Close the database. Before this, all iterators associated with the database |
| 65 // must be deleted. |
64 void HandleError(const tracked_objects::Location& from_here, | 66 void HandleError(const tracked_objects::Location& from_here, |
65 const leveldb::Status& status); | 67 const leveldb::Status& status); |
66 void ReportInitStatus(const leveldb::Status& status); | 68 void ReportInitStatus(const leveldb::Status& status); |
67 bool GetLastPathNumber(int* number); | 69 bool GetLastPathNumber(int* number); |
68 | 70 |
69 base::FilePath file_system_directory_; | 71 base::FilePath file_system_directory_; |
70 leveldb::Env* env_override_; | 72 leveldb::Env* env_override_; |
71 scoped_ptr<leveldb::DB> db_; | 73 scoped_ptr<leveldb::DB> db_; |
72 base::Time last_reported_time_; | 74 base::Time last_reported_time_; |
73 DISALLOW_COPY_AND_ASSIGN(SandboxOriginDatabase); | 75 DISALLOW_COPY_AND_ASSIGN(SandboxOriginDatabase); |
74 }; | 76 }; |
75 | 77 |
76 } // namespace storage | 78 } // namespace storage |
77 | 79 |
78 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_ | 80 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_ |
OLD | NEW |