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

Side by Side Diff: sync/syncable/delete_journal.cc

Issue 11533008: Use delete journal to remove bookmarks that are already deleted in sync model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « sync/sync.gyp ('k') | sync/syncable/directory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « sync/sync.gyp ('k') | sync/syncable/directory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698