| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // Requests to download updates for the |request_types|. For a well-behaved | 63 // Requests to download updates for the |request_types|. For a well-behaved |
| 64 // client with a working connection to the invalidations server, this should | 64 // client with a working connection to the invalidations server, this should |
| 65 // be unnecessary. It may be invoked periodically to try to keep the client | 65 // be unnecessary. It may be invoked periodically to try to keep the client |
| 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 ModelTypeSet request_types, |
| 73 sessions::SyncSession* session, | 74 sessions::SyncSession* session, |
| 74 base::Callback<void(sync_pb::ClientToServerMessage*)> build_fn); | 75 base::Callback<void(sync_pb::ClientToServerMessage*)> build_fn); |
| 75 | 76 |
| 76 // This function will commit batches of unsynced items to the server until the | 77 // 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 // 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 // encountered. A request to exit early will be treated as an error and will |
| 79 // abort any blocking operations. | 80 // abort any blocking operations. |
| 80 SyncerError BuildAndPostCommits( | 81 SyncerError BuildAndPostCommits( |
| 81 ModelTypeSet request_types, | 82 ModelTypeSet request_types, |
| 82 sessions::SyncSession* session); | 83 sessions::SyncSession* session); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 109 FRIEND_TEST_ALL_PREFIXES(SyncerTest, DeletingEntryWithLocalEdits); | 110 FRIEND_TEST_ALL_PREFIXES(SyncerTest, DeletingEntryWithLocalEdits); |
| 110 FRIEND_TEST_ALL_PREFIXES(EntryCreatedInNewFolderTest, | 111 FRIEND_TEST_ALL_PREFIXES(EntryCreatedInNewFolderTest, |
| 111 EntryCreatedInNewFolderMidSync); | 112 EntryCreatedInNewFolderMidSync); |
| 112 | 113 |
| 113 DISALLOW_COPY_AND_ASSIGN(Syncer); | 114 DISALLOW_COPY_AND_ASSIGN(Syncer); |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace syncer | 117 } // namespace syncer |
| 117 | 118 |
| 118 #endif // SYNC_ENGINE_SYNCER_H_ | 119 #endif // SYNC_ENGINE_SYNCER_H_ |
| OLD | NEW |