| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "sync/syncable/in_memory_directory_backing_store.h" | |
| 6 | |
| 7 namespace syncer { | |
| 8 namespace syncable { | |
| 9 | |
| 10 InMemoryDirectoryBackingStore::InMemoryDirectoryBackingStore( | |
| 11 const std::string& dir_name) | |
| 12 : DirectoryBackingStore(dir_name) { | |
| 13 } | |
| 14 | |
| 15 DirOpenResult InMemoryDirectoryBackingStore::Load( | |
| 16 Directory::MetahandlesMap* handles_map, | |
| 17 JournalIndex* delete_journals, | |
| 18 MetahandleSet* metahandles_to_purge, | |
| 19 Directory::KernelLoadInfo* kernel_load_info) { | |
| 20 if (!IsOpen()) { | |
| 21 if (!OpenInMemory()) | |
| 22 return FAILED_OPEN_DATABASE; | |
| 23 } | |
| 24 | |
| 25 if (!InitializeTables()) | |
| 26 return FAILED_OPEN_DATABASE; | |
| 27 | |
| 28 if (!LoadEntries(handles_map, metahandles_to_purge)) | |
| 29 return FAILED_DATABASE_CORRUPT; | |
| 30 if (!LoadDeleteJournals(delete_journals)) | |
| 31 return FAILED_DATABASE_CORRUPT; | |
| 32 if (!LoadInfo(kernel_load_info)) | |
| 33 return FAILED_DATABASE_CORRUPT; | |
| 34 if (!VerifyReferenceIntegrity(handles_map)) | |
| 35 return FAILED_DATABASE_CORRUPT; | |
| 36 | |
| 37 return OPENED; | |
| 38 } | |
| 39 | |
| 40 } // namespace syncable | |
| 41 } // namespace syncer | |
| OLD | NEW |