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

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

Issue 906403003: Revert of Use external ID to match native model nodes during bookmark association. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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/internal_api/public/delete_journal.h" 5 #include "sync/internal_api/public/delete_journal.h"
6 6
7 #include "sync/internal_api/public/base_transaction.h" 7 #include "sync/internal_api/public/base_transaction.h"
8 #include "sync/syncable/directory.h" 8 #include "sync/syncable/directory.h"
9 #include "sync/syncable/syncable_base_transaction.h" 9 #include "sync/syncable/syncable_base_transaction.h"
10 10
11 namespace syncer { 11 namespace syncer {
12 12
13 // static 13 // static
14 void DeleteJournal::GetBookmarkDeleteJournals( 14 void DeleteJournal::GetBookmarkDeleteJournals(
15 BaseTransaction* trans, BookmarkDeleteJournalList *delete_journal_list) { 15 BaseTransaction* trans, BookmarkDeleteJournalList *delete_journal_list) {
16 syncer::syncable::EntryKernelSet deleted_entries; 16 syncer::syncable::EntryKernelSet deleted_entries;
17 trans->GetDirectory()->delete_journal()->GetDeleteJournals( 17 trans->GetDirectory()->delete_journal()->GetDeleteJournals(
18 trans->GetWrappedTrans(), BOOKMARKS, &deleted_entries); 18 trans->GetWrappedTrans(), BOOKMARKS, &deleted_entries);
19 std::set<int64> undecryptable_journal; 19 std::set<int64> undecryptable_journal;
20 for (syncer::syncable::EntryKernelSet::const_iterator i = 20 for (syncer::syncable::EntryKernelSet::const_iterator i =
21 deleted_entries.begin(); i != deleted_entries.end(); ++i) { 21 deleted_entries.begin(); i != deleted_entries.end(); ++i) {
22 delete_journal_list->push_back(BookmarkDeleteJournal()); 22 delete_journal_list->push_back(BookmarkDeleteJournal());
23 delete_journal_list->back().id = (*i)->ref(syncer::syncable::META_HANDLE); 23 delete_journal_list->back().id = (*i)->ref(syncer::syncable::META_HANDLE);
24 delete_journal_list->back().external_id =
25 (*i)->ref(syncer::syncable::LOCAL_EXTERNAL_ID);
26 delete_journal_list->back().is_folder = (*i)->ref(syncer::syncable::IS_DIR); 24 delete_journal_list->back().is_folder = (*i)->ref(syncer::syncable::IS_DIR);
27 25
28 const sync_pb::EntitySpecifics& specifics = (*i)->ref( 26 const sync_pb::EntitySpecifics& specifics = (*i)->ref(
29 syncer::syncable::SPECIFICS); 27 syncer::syncable::SPECIFICS);
30 if (!specifics.has_encrypted()) { 28 if (!specifics.has_encrypted()) {
31 delete_journal_list->back().specifics = specifics; 29 delete_journal_list->back().specifics = specifics;
32 } else { 30 } else {
33 std::string plaintext_data = trans->GetCryptographer()->DecryptToString( 31 std::string plaintext_data = trans->GetCryptographer()->DecryptToString(
34 specifics.encrypted()); 32 specifics.encrypted());
35 sync_pb::EntitySpecifics unencrypted_data; 33 sync_pb::EntitySpecifics unencrypted_data;
(...skipping 15 matching lines...) Expand all
51 } 49 }
52 50
53 // static 51 // static
54 void DeleteJournal::PurgeDeleteJournals(BaseTransaction* trans, 52 void DeleteJournal::PurgeDeleteJournals(BaseTransaction* trans,
55 const std::set<int64>& ids) { 53 const std::set<int64>& ids) {
56 trans->GetDirectory()->delete_journal()->PurgeDeleteJournals( 54 trans->GetDirectory()->delete_journal()->PurgeDeleteJournals(
57 trans->GetWrappedTrans(), ids); 55 trans->GetWrappedTrans(), ids);
58 } 56 }
59 57
60 } // namespace syncer 58 } // namespace syncer
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_bookmark_unittest.cc ('k') | sync/internal_api/public/delete_journal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698