OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_IN
TERFACE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_IN
TERFACE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_IN
TERFACE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_IN
TERFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include "base/callback_forward.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 | 13 |
13 namespace sync_file_system { | 14 namespace sync_file_system { |
14 namespace drive_backend { | 15 namespace drive_backend { |
15 | 16 |
16 class FileMetadata; | 17 class FileMetadata; |
17 class FileTracker; | 18 class FileTracker; |
18 class TrackerIDSet; | 19 class TrackerIDSet; |
19 | 20 |
20 struct ParentIDAndTitle { | 21 struct ParentIDAndTitle { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 virtual std::string PickMultiTrackerFileID() const = 0; | 79 virtual std::string PickMultiTrackerFileID() const = 0; |
79 | 80 |
80 // Returns a pair of |parent_tracker_id| and |title| that has multiple file | 81 // Returns a pair of |parent_tracker_id| and |title| that has multiple file |
81 // at the path. | 82 // at the path. |
82 virtual ParentIDAndTitle PickMultiBackingFilePath() const = 0; | 83 virtual ParentIDAndTitle PickMultiBackingFilePath() const = 0; |
83 | 84 |
84 // Returns a FileTracker whose |dirty| is set and which isn't demoted. | 85 // Returns a FileTracker whose |dirty| is set and which isn't demoted. |
85 // Returns 0 if not found. | 86 // Returns 0 if not found. |
86 virtual int64 PickDirtyTracker() const = 0; | 87 virtual int64 PickDirtyTracker() const = 0; |
87 | 88 |
| 89 typedef base::Callback<void(int64 tracker_id)> TrackerIDCallback; |
| 90 virtual void EnumerateDirtyTrackers( |
| 91 const TrackerIDCallback& tracker) const = 0; |
| 92 |
88 // Demotes a dirty tracker. | 93 // Demotes a dirty tracker. |
89 virtual void DemoteDirtyTracker(int64 tracker_id) = 0; | 94 virtual void DemoteDirtyTracker(int64 tracker_id) = 0; |
90 | 95 |
91 virtual bool HasDemotedDirtyTracker() const = 0; | 96 virtual bool HasDemotedDirtyTracker() const = 0; |
92 | 97 |
93 // Promotes all demoted dirty trackers to normal dirty trackers. | 98 // Promotes all demoted dirty trackers to normal dirty trackers. |
94 virtual void PromoteDemotedDirtyTrackers() = 0; | 99 virtual void PromoteDemotedDirtyTrackers() = 0; |
95 | 100 |
96 virtual size_t CountDirtyTracker() const = 0; | 101 virtual size_t CountDirtyTracker() const = 0; |
97 virtual size_t CountFileMetadata() const = 0; | 102 virtual size_t CountFileMetadata() const = 0; |
(...skipping 10 matching lines...) Expand all Loading... |
108 virtual std::vector<std::string> GetAllMetadataIDs() const = 0; | 113 virtual std::vector<std::string> GetAllMetadataIDs() const = 0; |
109 | 114 |
110 private: | 115 private: |
111 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndexInterface); | 116 DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseIndexInterface); |
112 }; | 117 }; |
113 | 118 |
114 } // namespace drive_backend | 119 } // namespace drive_backend |
115 } // namespace sync_file_system | 120 } // namespace sync_file_system |
116 | 121 |
117 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX
_INTERFACE_H_ | 122 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX
_INTERFACE_H_ |
OLD | NEW |