| 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/internal_api/public/delete_journal.h" | 5 #include "sync/internal_api/public/delete_journal.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <set> | 9 #include <set> |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "sync/internal_api/public/base_transaction.h" | 12 #include "sync/internal_api/public/base_transaction.h" |
| 11 #include "sync/syncable/directory.h" | 13 #include "sync/syncable/directory.h" |
| 12 #include "sync/syncable/syncable_base_transaction.h" | 14 #include "sync/syncable/syncable_base_transaction.h" |
| 13 | 15 |
| 14 namespace syncer { | 16 namespace syncer { |
| 15 | 17 |
| 16 // static | 18 // static |
| 17 void DeleteJournal::GetBookmarkDeleteJournals( | 19 void DeleteJournal::GetBookmarkDeleteJournals( |
| 18 BaseTransaction* trans, BookmarkDeleteJournalList *delete_journal_list) { | 20 BaseTransaction* trans, BookmarkDeleteJournalList *delete_journal_list) { |
| 19 syncer::syncable::EntryKernelSet deleted_entries; | 21 syncer::syncable::EntryKernelSet deleted_entries; |
| 20 trans->GetDirectory()->delete_journal()->GetDeleteJournals( | 22 trans->GetDirectory()->delete_journal()->GetDeleteJournals( |
| 21 trans->GetWrappedTrans(), BOOKMARKS, &deleted_entries); | 23 trans->GetWrappedTrans(), BOOKMARKS, &deleted_entries); |
| 22 std::set<int64> undecryptable_journal; | 24 std::set<int64_t> undecryptable_journal; |
| 23 for (syncer::syncable::EntryKernelSet::const_iterator i = | 25 for (syncer::syncable::EntryKernelSet::const_iterator i = |
| 24 deleted_entries.begin(); i != deleted_entries.end(); ++i) { | 26 deleted_entries.begin(); i != deleted_entries.end(); ++i) { |
| 25 delete_journal_list->push_back(BookmarkDeleteJournal()); | 27 delete_journal_list->push_back(BookmarkDeleteJournal()); |
| 26 delete_journal_list->back().id = (*i)->ref(syncer::syncable::META_HANDLE); | 28 delete_journal_list->back().id = (*i)->ref(syncer::syncable::META_HANDLE); |
| 27 delete_journal_list->back().external_id = | 29 delete_journal_list->back().external_id = |
| 28 (*i)->ref(syncer::syncable::LOCAL_EXTERNAL_ID); | 30 (*i)->ref(syncer::syncable::LOCAL_EXTERNAL_ID); |
| 29 delete_journal_list->back().is_folder = (*i)->ref(syncer::syncable::IS_DIR); | 31 delete_journal_list->back().is_folder = (*i)->ref(syncer::syncable::IS_DIR); |
| 30 | 32 |
| 31 const sync_pb::EntitySpecifics& specifics = (*i)->ref( | 33 const sync_pb::EntitySpecifics& specifics = (*i)->ref( |
| 32 syncer::syncable::SPECIFICS); | 34 syncer::syncable::SPECIFICS); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 48 } | 50 } |
| 49 | 51 |
| 50 if (!undecryptable_journal.empty()) { | 52 if (!undecryptable_journal.empty()) { |
| 51 trans->GetDirectory()->delete_journal()->PurgeDeleteJournals( | 53 trans->GetDirectory()->delete_journal()->PurgeDeleteJournals( |
| 52 trans->GetWrappedTrans(), undecryptable_journal); | 54 trans->GetWrappedTrans(), undecryptable_journal); |
| 53 } | 55 } |
| 54 } | 56 } |
| 55 | 57 |
| 56 // static | 58 // static |
| 57 void DeleteJournal::PurgeDeleteJournals(BaseTransaction* trans, | 59 void DeleteJournal::PurgeDeleteJournals(BaseTransaction* trans, |
| 58 const std::set<int64>& ids) { | 60 const std::set<int64_t>& ids) { |
| 59 trans->GetDirectory()->delete_journal()->PurgeDeleteJournals( | 61 trans->GetDirectory()->delete_journal()->PurgeDeleteJournals( |
| 60 trans->GetWrappedTrans(), ids); | 62 trans->GetWrappedTrans(), ids); |
| 61 } | 63 } |
| 62 | 64 |
| 63 } // namespace syncer | 65 } // namespace syncer |
| OLD | NEW |