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

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

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
« no previous file with comments | « sync/syncable/nigori_util_unittest.cc ('k') | sync/syncable/on_disk_directory_backing_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 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 #ifndef SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_
6 #define SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_
7
8 #include <string>
9
10 #include "base/files/file_path.h"
11 #include "base/macros.h"
12 #include "sync/base/sync_export.h"
13 #include "sync/syncable/directory_backing_store.h"
14
15 namespace syncer {
16 namespace syncable {
17
18 // This is the concrete class that provides a useful implementation of
19 // DirectoryBackingStore.
20 class SYNC_EXPORT OnDiskDirectoryBackingStore : public DirectoryBackingStore {
21 public:
22 OnDiskDirectoryBackingStore(const std::string& dir_name,
23 const base::FilePath& backing_file_path);
24 ~OnDiskDirectoryBackingStore() override;
25 DirOpenResult Load(Directory::MetahandlesMap* handles_map,
26 JournalIndex* delete_journals,
27 MetahandleSet* metahandles_to_purge,
28 Directory::KernelLoadInfo* kernel_load_info) override;
29
30 protected:
31 // Subclasses may override this to avoid a possible DCHECK.
32 virtual void ReportFirstTryOpenFailure();
33
34 // Returns the file path of the back store.
35 const base::FilePath& backing_file_path() const;
36
37 private:
38 // A helper function that will make one attempt to load the directory.
39 // Unlike Load(), it does not attempt to recover from failure.
40 DirOpenResult TryLoad(Directory::MetahandlesMap* handles_map,
41 JournalIndex* delete_journals,
42 MetahandleSet* metahandles_to_purge,
43 Directory::KernelLoadInfo* kernel_load_info);
44
45 // The path to the sync DB.
46 const base::FilePath backing_file_path_;
47
48 DISALLOW_COPY_AND_ASSIGN(OnDiskDirectoryBackingStore);
49 };
50
51 } // namespace syncable
52 } // namespace syncer
53
54 #endif // SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_
OLDNEW
« no previous file with comments | « sync/syncable/nigori_util_unittest.cc ('k') | sync/syncable/on_disk_directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698