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

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

Issue 1639973002: FileSystem: Prevent iterator from being deleted after database. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments. Created 4 years, 10 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
« no previous file with comments | « no previous file | storage/browser/fileapi/sandbox_directory_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 friend class ObfuscatedFileUtil; 116 friend class ObfuscatedFileUtil;
117 117
118 bool Init(RecoveryOption recovery_option); 118 bool Init(RecoveryOption recovery_option);
119 bool RepairDatabase(const std::string& db_path); 119 bool RepairDatabase(const std::string& db_path);
120 void ReportInitStatus(const leveldb::Status& status); 120 void ReportInitStatus(const leveldb::Status& status);
121 bool StoreDefaultValues(); 121 bool StoreDefaultValues();
122 bool GetLastFileId(FileId* file_id); 122 bool GetLastFileId(FileId* file_id);
123 bool AddFileInfoHelper( 123 bool AddFileInfoHelper(
124 const FileInfo& info, FileId file_id, leveldb::WriteBatch* batch); 124 const FileInfo& info, FileId file_id, leveldb::WriteBatch* batch);
125 bool RemoveFileInfoHelper(FileId file_id, leveldb::WriteBatch* batch); 125 bool RemoveFileInfoHelper(FileId file_id, leveldb::WriteBatch* batch);
126 // Close the database. Before this, all iterators associated with the database
127 // must be deleted.
126 void HandleError(const tracked_objects::Location& from_here, 128 void HandleError(const tracked_objects::Location& from_here,
127 const leveldb::Status& status); 129 const leveldb::Status& status);
128 130
129 const base::FilePath filesystem_data_directory_; 131 const base::FilePath filesystem_data_directory_;
130 leveldb::Env* env_override_; 132 leveldb::Env* env_override_;
131 scoped_ptr<leveldb::DB> db_; 133 scoped_ptr<leveldb::DB> db_;
132 base::Time last_reported_time_; 134 base::Time last_reported_time_;
133 DISALLOW_COPY_AND_ASSIGN(SandboxDirectoryDatabase); 135 DISALLOW_COPY_AND_ASSIGN(SandboxDirectoryDatabase);
134 }; 136 };
135 137
136 } // namespace storage 138 } // namespace storage
137 139
138 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_ 140 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | storage/browser/fileapi/sandbox_directory_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698