| 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 SYNC_SYNCABLE_SYNCABLE_DELETE_JOURNAL_H_ | 5 #ifndef SYNC_SYNCABLE_SYNCABLE_DELETE_JOURNAL_H_ |
| 6 #define SYNC_SYNCABLE_SYNCABLE_DELETE_JOURNAL_H_ | 6 #define SYNC_SYNCABLE_SYNCABLE_DELETE_JOURNAL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "sync/base/sync_export.h" |
| 12 #include "sync/syncable/metahandle_set.h" | 13 #include "sync/syncable/metahandle_set.h" |
| 13 #include "sync/syncable/syncable-inl.h" | 14 #include "sync/syncable/syncable-inl.h" |
| 14 | 15 |
| 15 namespace syncer { | 16 namespace syncer { |
| 16 namespace syncable { | 17 namespace syncable { |
| 17 | 18 |
| 18 class BaseTransaction; | 19 class BaseTransaction; |
| 19 struct EntryKernel; | 20 struct EntryKernel; |
| 20 | 21 |
| 21 typedef std::set<const EntryKernel*, LessField<IdField, ID> > JournalIndex; | 22 typedef std::set<const EntryKernel*, LessField<IdField, ID> > JournalIndex; |
| 22 | 23 |
| 23 // DeleteJournal manages deleted entries that are not in sync directory until | 24 // DeleteJournal manages deleted entries that are not in sync directory until |
| 24 // it's safe to drop them after the deletion is confirmed with native models. | 25 // it's safe to drop them after the deletion is confirmed with native models. |
| 25 // DeleteJournal is thread-safe and can be accessed on any thread. Has to hold | 26 // DeleteJournal is thread-safe and can be accessed on any thread. Has to hold |
| 26 // a valid transaction object when calling methods of DeleteJournal, thus each | 27 // a valid transaction object when calling methods of DeleteJournal, thus each |
| 27 // method requires a non-null |trans| parameter. | 28 // method requires a non-null |trans| parameter. |
| 28 class DeleteJournal { | 29 class SYNC_EXPORT_PRIVATE DeleteJournal { |
| 29 public: | 30 public: |
| 30 FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest, ManageDeleteJournals); | 31 FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest, ManageDeleteJournals); |
| 31 | 32 |
| 32 // Initialize |delete_journals_| using |intitial_journal|, whose content is | 33 // Initialize |delete_journals_| using |intitial_journal|, whose content is |
| 33 // destroyed during initialization. | 34 // destroyed during initialization. |
| 34 explicit DeleteJournal(JournalIndex* initial_journal); | 35 explicit DeleteJournal(JournalIndex* initial_journal); |
| 35 ~DeleteJournal(); | 36 ~DeleteJournal(); |
| 36 | 37 |
| 37 // For testing only. | 38 // For testing only. |
| 38 size_t GetDeleteJournalSize(BaseTransaction* trans) const; | 39 size_t GetDeleteJournalSize(BaseTransaction* trans) const; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // saved to database. | 95 // saved to database. |
| 95 ModelTypeSet passive_delete_journal_types_; | 96 ModelTypeSet passive_delete_journal_types_; |
| 96 | 97 |
| 97 DISALLOW_COPY_AND_ASSIGN(DeleteJournal); | 98 DISALLOW_COPY_AND_ASSIGN(DeleteJournal); |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 } // namespace syncable | 101 } // namespace syncable |
| 101 } // namespace syncer | 102 } // namespace syncer |
| 102 | 103 |
| 103 #endif // SYNC_SYNCABLE_SYNCABLE_DELETE_JOURNAL_H_ | 104 #endif // SYNC_SYNCABLE_SYNCABLE_DELETE_JOURNAL_H_ |
| OLD | NEW |