OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 bool ShouldKeepDirty(const FileTracker& tracker) const; | 328 bool ShouldKeepDirty(const FileTracker& tracker) const; |
329 | 329 |
330 bool HasDisabledAppRoot(const FileTracker& tracker) const; | 330 bool HasDisabledAppRoot(const FileTracker& tracker) const; |
331 bool HasActiveTrackerForFileID(const std::string& file_id) const; | 331 bool HasActiveTrackerForFileID(const std::string& file_id) const; |
332 bool HasActiveTrackerForPath(int64 parent_tracker, | 332 bool HasActiveTrackerForPath(int64 parent_tracker, |
333 const std::string& title) const; | 333 const std::string& title) const; |
334 | 334 |
335 void WriteToDatabase(scoped_ptr<leveldb::WriteBatch> batch, | 335 void WriteToDatabase(scoped_ptr<leveldb::WriteBatch> batch, |
336 const SyncStatusCallback& callback); | 336 const SyncStatusCallback& callback); |
337 | 337 |
| 338 bool HasNewerFileMetadata(const std::string& file_id, int64 change_id); |
| 339 |
338 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 340 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
339 scoped_ptr<leveldb::DB> db_; | 341 scoped_ptr<leveldb::DB> db_; |
340 | 342 |
341 scoped_ptr<ServiceMetadata> service_metadata_; | 343 scoped_ptr<ServiceMetadata> service_metadata_; |
| 344 int64 largest_known_change_id_; |
342 | 345 |
343 FileByID file_by_id_; // Owned. | 346 FileByID file_by_id_; // Owned. |
344 TrackerByID tracker_by_id_; // Owned. | 347 TrackerByID tracker_by_id_; // Owned. |
345 | 348 |
346 // Maps FileID to trackers. The active tracker must be unique per FileID. | 349 // Maps FileID to trackers. The active tracker must be unique per FileID. |
347 // This must be updated when updating |active| field of a tracker. | 350 // This must be updated when updating |active| field of a tracker. |
348 TrackersByFileID trackers_by_file_id_; // Not owned. | 351 TrackersByFileID trackers_by_file_id_; // Not owned. |
349 | 352 |
350 // Maps AppID to the app-root tracker. | 353 // Maps AppID to the app-root tracker. |
351 // This must be updated when a tracker is registered/unregistered as an | 354 // This must be updated when a tracker is registered/unregistered as an |
(...skipping 15 matching lines...) Expand all Loading... |
367 | 370 |
368 base::WeakPtrFactory<MetadataDatabase> weak_ptr_factory_; | 371 base::WeakPtrFactory<MetadataDatabase> weak_ptr_factory_; |
369 | 372 |
370 DISALLOW_COPY_AND_ASSIGN(MetadataDatabase); | 373 DISALLOW_COPY_AND_ASSIGN(MetadataDatabase); |
371 }; | 374 }; |
372 | 375 |
373 } // namespace drive_backend | 376 } // namespace drive_backend |
374 } // namespace sync_file_system | 377 } // namespace sync_file_system |
375 | 378 |
376 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ | 379 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ |
OLD | NEW |