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 #ifndef SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "sync/base/sync_export.h" | 10 #include "sync/base/sync_export.h" |
11 #include "sync/internal_api/public/base/model_type.h" | 11 #include "sync/internal_api/public/base/model_type.h" |
12 #include "sync/protocol/sync.pb.h" | 12 #include "sync/protocol/sync.pb.h" |
13 | 13 |
14 namespace syncer { | 14 namespace syncer { |
15 | 15 |
16 class BaseTransaction; | 16 class BaseTransaction; |
17 | 17 |
18 struct BookmarkDeleteJournal { | 18 struct BookmarkDeleteJournal { |
19 int64 id; // Metahandle of delete journal entry. | 19 int64 id; // Metahandle of delete journal entry. |
| 20 int64 external_id; // Bookmark ID in the native model. |
20 bool is_folder; | 21 bool is_folder; |
21 sync_pb::EntitySpecifics specifics; | 22 sync_pb::EntitySpecifics specifics; |
22 }; | 23 }; |
23 typedef std::vector<BookmarkDeleteJournal> BookmarkDeleteJournalList; | 24 typedef std::vector<BookmarkDeleteJournal> BookmarkDeleteJournalList; |
24 | 25 |
25 // Static APIs for passing delete journals between syncer::syncable namspace | 26 // Static APIs for passing delete journals between syncer::syncable namspace |
26 // and syncer namespace. | 27 // and syncer namespace. |
27 class SYNC_EXPORT DeleteJournal { | 28 class SYNC_EXPORT DeleteJournal { |
28 public: | 29 public: |
29 // Return info about deleted bookmark entries stored in the delete journal | 30 // Return info about deleted bookmark entries stored in the delete journal |
30 // of |trans|'s directory. | 31 // of |trans|'s directory. |
31 // TODO(haitaol): remove this after SyncData supports bookmarks and | 32 // TODO(haitaol): remove this after SyncData supports bookmarks and |
32 // all types of delete journals can be returned as | 33 // all types of delete journals can be returned as |
33 // SyncDataList. | 34 // SyncDataList. |
34 static void GetBookmarkDeleteJournals( | 35 static void GetBookmarkDeleteJournals( |
35 BaseTransaction* trans, BookmarkDeleteJournalList *delete_journals); | 36 BaseTransaction* trans, BookmarkDeleteJournalList *delete_journals); |
36 | 37 |
37 // Purge delete journals of given IDs from |trans|'s directory. | 38 // Purge delete journals of given IDs from |trans|'s directory. |
38 static void PurgeDeleteJournals(BaseTransaction* trans, | 39 static void PurgeDeleteJournals(BaseTransaction* trans, |
39 const std::set<int64>& ids); | 40 const std::set<int64>& ids); |
40 }; | 41 }; |
41 | 42 |
42 } // namespace syncer | 43 } // namespace syncer |
43 | 44 |
44 #endif // SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ | 45 #endif // SYNC_INTERNAL_API_PUBLIC_DELETE_JOURNAL_H_ |
OLD | NEW |