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

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

Issue 7042029: Code to migrate a single directory from the old sandbox to the new. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Attempted windows fix. Created 9 years, 7 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
« no previous file with comments | « no previous file | webkit/fileapi/file_system_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) 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // another file [also not a directory]; we need to alter two files' info in a 73 // another file [also not a directory]; we need to alter two files' info in a
74 // single transaction to avoid weird backing file references in the event of a 74 // single transaction to avoid weird backing file references in the event of a
75 // partial failure. 75 // partial failure.
76 bool OverwritingMoveFile(FileId src_file_id, FileId dest_file_id); 76 bool OverwritingMoveFile(FileId src_file_id, FileId dest_file_id);
77 77
78 // This produces the series 0, 1, 2..., starting at 0 when the underlying 78 // This produces the series 0, 1, 2..., starting at 0 when the underlying
79 // filesystem is first created, and maintaining state across 79 // filesystem is first created, and maintaining state across
80 // creation/destruction of FileSystemDirectoryDatabase objects. 80 // creation/destruction of FileSystemDirectoryDatabase objects.
81 bool GetNextInteger(int64* next); 81 bool GetNextInteger(int64* next);
82 82
83 static bool DestroyDatabase(const FilePath& path);
84
83 private: 85 private:
84 bool Init(); 86 bool Init();
85 bool StoreDefaultValues(); 87 bool StoreDefaultValues();
86 bool GetLastFileId(FileId* file_id); 88 bool GetLastFileId(FileId* file_id);
87 bool VerifyIsDirectory(FileId file_id); 89 bool VerifyIsDirectory(FileId file_id);
88 bool AddFileInfoHelper( 90 bool AddFileInfoHelper(
89 const FileInfo& info, FileId file_id, leveldb::WriteBatch* batch); 91 const FileInfo& info, FileId file_id, leveldb::WriteBatch* batch);
90 bool RemoveFileInfoHelper(FileId file_id, leveldb::WriteBatch* batch); 92 bool RemoveFileInfoHelper(FileId file_id, leveldb::WriteBatch* batch);
91 void HandleError(leveldb::Status status); 93 void HandleError(leveldb::Status status);
92 94
93 std::string path_; 95 std::string path_;
94 scoped_ptr<leveldb::DB> db_; 96 scoped_ptr<leveldb::DB> db_;
95 }; 97 };
96 98
97 } // namespace fileapi 99 } // namespace fileapi
98 100
99 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_DIRECTORY_DATABASE_H 101 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_DIRECTORY_DATABASE_H
OLDNEW
« no previous file with comments | « no previous file | webkit/fileapi/file_system_directory_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698