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

Side by Side Diff: components/sync/syncable/in_memory_directory_backing_store.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
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 #include "sync/syncable/in_memory_directory_backing_store.h" 5 #include "components/sync/syncable/in_memory_directory_backing_store.h"
6 6
7 namespace syncer { 7 namespace syncer {
8 namespace syncable { 8 namespace syncable {
9 9
10 InMemoryDirectoryBackingStore::InMemoryDirectoryBackingStore( 10 InMemoryDirectoryBackingStore::InMemoryDirectoryBackingStore(
11 const std::string& dir_name) 11 const std::string& dir_name)
12 : DirectoryBackingStore(dir_name) { 12 : DirectoryBackingStore(dir_name) {}
13 }
14 13
15 DirOpenResult InMemoryDirectoryBackingStore::Load( 14 DirOpenResult InMemoryDirectoryBackingStore::Load(
16 Directory::MetahandlesMap* handles_map, 15 Directory::MetahandlesMap* handles_map,
17 JournalIndex* delete_journals, 16 JournalIndex* delete_journals,
18 MetahandleSet* metahandles_to_purge, 17 MetahandleSet* metahandles_to_purge,
19 Directory::KernelLoadInfo* kernel_load_info) { 18 Directory::KernelLoadInfo* kernel_load_info) {
20 if (!IsOpen()) { 19 if (!IsOpen()) {
21 if (!OpenInMemory()) 20 if (!OpenInMemory())
22 return FAILED_OPEN_DATABASE; 21 return FAILED_OPEN_DATABASE;
23 } 22 }
24 23
25 if (!InitializeTables()) 24 if (!InitializeTables())
26 return FAILED_OPEN_DATABASE; 25 return FAILED_OPEN_DATABASE;
27 26
28 if (!LoadEntries(handles_map, metahandles_to_purge)) 27 if (!LoadEntries(handles_map, metahandles_to_purge))
29 return FAILED_DATABASE_CORRUPT; 28 return FAILED_DATABASE_CORRUPT;
30 if (!LoadDeleteJournals(delete_journals)) 29 if (!LoadDeleteJournals(delete_journals))
31 return FAILED_DATABASE_CORRUPT; 30 return FAILED_DATABASE_CORRUPT;
32 if (!LoadInfo(kernel_load_info)) 31 if (!LoadInfo(kernel_load_info))
33 return FAILED_DATABASE_CORRUPT; 32 return FAILED_DATABASE_CORRUPT;
34 if (!VerifyReferenceIntegrity(handles_map)) 33 if (!VerifyReferenceIntegrity(handles_map))
35 return FAILED_DATABASE_CORRUPT; 34 return FAILED_DATABASE_CORRUPT;
36 35
37 return OPENED; 36 return OPENED;
38 } 37 }
39 38
40 } // namespace syncable 39 } // namespace syncable
41 } // namespace syncer 40 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698