| OLD | NEW |
| 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_DIRECTORY_DATABASE_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_DIRECTORY_DATABASE_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_DIRECTORY_DATABASE_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_DIRECTORY_DATABASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // done elsewhere]. | 31 // done elsewhere]. |
| 32 // TODO(ericu): Add a method that will give a unique filename for a data file. | 32 // TODO(ericu): Add a method that will give a unique filename for a data file. |
| 33 class FileSystemDirectoryDatabase { | 33 class FileSystemDirectoryDatabase { |
| 34 public: | 34 public: |
| 35 typedef int64 FileId; | 35 typedef int64 FileId; |
| 36 | 36 |
| 37 struct FileInfo { | 37 struct FileInfo { |
| 38 FileInfo(); | 38 FileInfo(); |
| 39 ~FileInfo(); | 39 ~FileInfo(); |
| 40 | 40 |
| 41 bool is_directory() { | 41 bool is_directory() const { |
| 42 return data_path.empty(); | 42 return data_path.empty(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 FileId parent_id; | 45 FileId parent_id; |
| 46 FilePath data_path; | 46 FilePath data_path; |
| 47 FilePath::StringType name; | 47 FilePath::StringType name; |
| 48 // This modification time is valid only for directories, not files, as | 48 // This modification time is valid only for directories, not files, as |
| 49 // FileWriter will get the files out of sync. | 49 // FileWriter will get the files out of sync. |
| 50 // For files, look at the modification time of the underlying data_path. | 50 // For files, look at the modification time of the underlying data_path. |
| 51 base::Time modification_time; | 51 base::Time modification_time; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 bool RemoveFileInfoHelper(FileId file_id, leveldb::WriteBatch* batch); | 92 bool RemoveFileInfoHelper(FileId file_id, leveldb::WriteBatch* batch); |
| 93 void HandleError(leveldb::Status status); | 93 void HandleError(leveldb::Status status); |
| 94 | 94 |
| 95 std::string path_; | 95 std::string path_; |
| 96 scoped_ptr<leveldb::DB> db_; | 96 scoped_ptr<leveldb::DB> db_; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace fileapi | 99 } // namespace fileapi |
| 100 | 100 |
| 101 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_DIRECTORY_DATABASE_H_ | 101 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_DIRECTORY_DATABASE_H_ |
| OLD | NEW |