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

Side by Side Diff: sync/syncable/on_disk_directory_backing_store.h

Issue 11441026: [Sync] Add support for loading, updating and querying delete journals in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
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 #ifndef SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_ 5 #ifndef SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_
6 #define SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_ 6 #define SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_
7 7
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "sync/syncable/directory_backing_store.h" 9 #include "sync/syncable/directory_backing_store.h"
10 10
11 namespace syncer { 11 namespace syncer {
12 namespace syncable { 12 namespace syncable {
13 13
14 // This is the concrete class that provides a useful implementation of 14 // This is the concrete class that provides a useful implementation of
15 // DirectoryBackingStore. 15 // DirectoryBackingStore.
16 class OnDiskDirectoryBackingStore : public DirectoryBackingStore { 16 class OnDiskDirectoryBackingStore : public DirectoryBackingStore {
17 public: 17 public:
18 OnDiskDirectoryBackingStore(const std::string& dir_name, 18 OnDiskDirectoryBackingStore(const std::string& dir_name,
19 const FilePath& backing_filepath); 19 const FilePath& backing_filepath);
20 virtual ~OnDiskDirectoryBackingStore(); 20 virtual ~OnDiskDirectoryBackingStore();
21 virtual DirOpenResult Load( 21 virtual DirOpenResult Load(
22 MetahandlesIndex* entry_bucket, 22 MetahandlesIndex* entry_bucket,
23 IdsIndex* delete_journals,
23 Directory::KernelLoadInfo* kernel_load_info) OVERRIDE; 24 Directory::KernelLoadInfo* kernel_load_info) OVERRIDE;
24 25
25 // A helper function that will make one attempt to load the directory. 26 // A helper function that will make one attempt to load the directory.
26 // Unlike Load(), it does not attempt to recover from failure. 27 // Unlike Load(), it does not attempt to recover from failure.
27 DirOpenResult TryLoad( 28 DirOpenResult TryLoad(
28 MetahandlesIndex* entry_bucket, 29 MetahandlesIndex* entry_bucket,
30 IdsIndex* delete_journals,
29 Directory::KernelLoadInfo* kernel_load_info); 31 Directory::KernelLoadInfo* kernel_load_info);
30 32
31 protected: 33 protected:
32 // Subclasses may override this to avoid a possible DCHECK. 34 // Subclasses may override this to avoid a possible DCHECK.
33 virtual void ReportFirstTryOpenFailure(); 35 virtual void ReportFirstTryOpenFailure();
34 36
35 private: 37 private:
36 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MinorCorruption); 38 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MinorCorruption);
37 39
38 bool allow_failure_for_test_; 40 bool allow_failure_for_test_;
39 FilePath backing_filepath_; 41 FilePath backing_filepath_;
40 }; 42 };
41 43
42 } // namespace syncable 44 } // namespace syncable
43 } // namespace syncer 45 } // namespace syncer
44 46
45 #endif // SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_ 47 #endif // SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698