OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/sync_file_system/drive_backend/metadata_db_migration_ut
il.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/metadata_db_migration_ut
il.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" | 10 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" |
| 11 #include "storage/common/fileapi/file_system_types.h" |
| 12 #include "storage/common/fileapi/file_system_util.h" |
11 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 13 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
12 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" | 14 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" |
13 #include "url/gurl.h" | 15 #include "url/gurl.h" |
14 #include "webkit/common/fileapi/file_system_types.h" | |
15 #include "webkit/common/fileapi/file_system_util.h" | |
16 | 16 |
17 namespace sync_file_system { | 17 namespace sync_file_system { |
18 namespace drive_backend { | 18 namespace drive_backend { |
19 | 19 |
20 SyncStatusCode MigrateDatabaseFromV4ToV3(leveldb::DB* db) { | 20 SyncStatusCode MigrateDatabaseFromV4ToV3(leveldb::DB* db) { |
21 // Rollback from version 4 to version 3. | 21 // Rollback from version 4 to version 3. |
22 // Please see metadata_database_index.cc for version 3 format, and | 22 // Please see metadata_database_index.cc for version 3 format, and |
23 // metadata_database_index_on_disk.cc for version 4 format. | 23 // metadata_database_index_on_disk.cc for version 4 format. |
24 | 24 |
25 const char kDatabaseVersionKey[] = "VERSION"; | 25 const char kDatabaseVersionKey[] = "VERSION"; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 DVLOG(3) << "Unknown key: " << key << " was found."; | 69 DVLOG(3) << "Unknown key: " << key << " was found."; |
70 } | 70 } |
71 | 71 |
72 return LevelDBStatusToSyncStatusCode( | 72 return LevelDBStatusToSyncStatusCode( |
73 db->Write(leveldb::WriteOptions(), &write_batch)); | 73 db->Write(leveldb::WriteOptions(), &write_batch)); |
74 } | 74 } |
75 | 75 |
76 } // namespace drive_backend | 76 } // namespace drive_backend |
77 } // namespace sync_file_system | 77 } // namespace sync_file_system |
OLD | NEW |