OLD | NEW |
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 #include "sync/syncable/delete_journal.h" | 5 #include "sync/syncable/delete_journal.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "sync/internal_api/public/base/model_type.h" | 8 #include "sync/internal_api/public/base/model_type.h" |
9 | 9 |
10 namespace syncer { | 10 namespace syncer { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } else if (was_deleted) { | 61 } else if (was_deleted) { |
62 delete_journals_to_purge_.insert(entry.ref(META_HANDLE)); | 62 delete_journals_to_purge_.insert(entry.ref(META_HANDLE)); |
63 } | 63 } |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 void DeleteJournal::GetDeleteJournals(BaseTransaction* trans, | 67 void DeleteJournal::GetDeleteJournals(BaseTransaction* trans, |
68 ModelType type, | 68 ModelType type, |
69 EntryKernelSet* deleted_entries) { | 69 EntryKernelSet* deleted_entries) { |
70 DCHECK(trans); | 70 DCHECK(trans); |
71 DCHECK(!passive_delete_journal_types_.Has(type)); | |
72 for (JournalIndex::const_iterator it = delete_journals_.begin(); | 71 for (JournalIndex::const_iterator it = delete_journals_.begin(); |
73 it != delete_journals_.end(); ++it) { | 72 it != delete_journals_.end(); ++it) { |
74 if ((*it)->GetServerModelType() == type || | 73 if ((*it)->GetServerModelType() == type || |
75 GetModelTypeFromSpecifics((*it)->ref(SPECIFICS)) == type) { | 74 GetModelTypeFromSpecifics((*it)->ref(SPECIFICS)) == type) { |
76 deleted_entries->insert(*it); | 75 deleted_entries->insert(*it); |
77 } | 76 } |
78 } | 77 } |
79 passive_delete_journal_types_.Put(type); | 78 passive_delete_journal_types_.Put(type); |
80 } | 79 } |
81 | 80 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 switch (type) { | 134 switch (type) { |
136 case BOOKMARKS: | 135 case BOOKMARKS: |
137 return true; | 136 return true; |
138 default: | 137 default: |
139 return false; | 138 return false; |
140 } | 139 } |
141 } | 140 } |
142 | 141 |
143 } // namespace syncable | 142 } // namespace syncable |
144 } // namespace syncer | 143 } // namespace syncer |
OLD | NEW |