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_ENGINE_SYNCER_H_ | 5 #ifndef SYNC_ENGINE_SYNCER_H_ |
6 #define SYNC_ENGINE_SYNCER_H_ | 6 #define SYNC_ENGINE_SYNCER_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // in sync despite bugs or transient failures. | 66 // in sync despite bugs or transient failures. |
67 virtual bool PollSyncShare(ModelTypeSet request_types, | 67 virtual bool PollSyncShare(ModelTypeSet request_types, |
68 sessions::SyncSession* session); | 68 sessions::SyncSession* session); |
69 | 69 |
70 private: | 70 private: |
71 void ApplyUpdates(sessions::SyncSession* session); | 71 void ApplyUpdates(sessions::SyncSession* session); |
72 bool DownloadAndApplyUpdates( | 72 bool DownloadAndApplyUpdates( |
73 sessions::SyncSession* session, | 73 sessions::SyncSession* session, |
74 base::Callback<void(sync_pb::ClientToServerMessage*)> build_fn); | 74 base::Callback<void(sync_pb::ClientToServerMessage*)> build_fn); |
75 | 75 |
| 76 // This function will commit batches of unsynced items to the server until the |
| 77 // number of unsynced and ready to commit items reaches zero or an error is |
| 78 // encountered. A request to exit early will be treated as an error and will |
| 79 // abort any blocking operations. |
| 80 SyncerError BuildAndPostCommits( |
| 81 ModelTypeSet request_types, |
| 82 sessions::SyncSession* session); |
| 83 |
76 void HandleCycleBegin(sessions::SyncSession* session); | 84 void HandleCycleBegin(sessions::SyncSession* session); |
77 bool HandleCycleEnd( | 85 bool HandleCycleEnd( |
78 sessions::SyncSession* session, | 86 sessions::SyncSession* session, |
79 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source); | 87 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source); |
80 | 88 |
81 syncer::CancelationSignal* const cancelation_signal_; | 89 syncer::CancelationSignal* const cancelation_signal_; |
82 | 90 |
83 friend class SyncerTest; | 91 friend class SyncerTest; |
84 FRIEND_TEST_ALL_PREFIXES(SyncerTest, NameClashWithResolver); | 92 FRIEND_TEST_ALL_PREFIXES(SyncerTest, NameClashWithResolver); |
85 FRIEND_TEST_ALL_PREFIXES(SyncerTest, IllegalAndLegalUpdates); | 93 FRIEND_TEST_ALL_PREFIXES(SyncerTest, IllegalAndLegalUpdates); |
(...skipping 15 matching lines...) Expand all Loading... |
101 FRIEND_TEST_ALL_PREFIXES(SyncerTest, DeletingEntryWithLocalEdits); | 109 FRIEND_TEST_ALL_PREFIXES(SyncerTest, DeletingEntryWithLocalEdits); |
102 FRIEND_TEST_ALL_PREFIXES(EntryCreatedInNewFolderTest, | 110 FRIEND_TEST_ALL_PREFIXES(EntryCreatedInNewFolderTest, |
103 EntryCreatedInNewFolderMidSync); | 111 EntryCreatedInNewFolderMidSync); |
104 | 112 |
105 DISALLOW_COPY_AND_ASSIGN(Syncer); | 113 DISALLOW_COPY_AND_ASSIGN(Syncer); |
106 }; | 114 }; |
107 | 115 |
108 } // namespace syncer | 116 } // namespace syncer |
109 | 117 |
110 #endif // SYNC_ENGINE_SYNCER_H_ | 118 #endif // SYNC_ENGINE_SYNCER_H_ |
OLD | NEW |