| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // SyncerSession holds the entire state of a single sync cycle; GetUpdates, | 5 // SyncerSession holds the entire state of a single sync cycle; GetUpdates, |
| 6 // Commit, and Conflict Resolution. After said cycle, the Session may contain | 6 // Commit, and Conflict Resolution. After said cycle, the Session may contain |
| 7 // items that were unable to be processed because of errors. | 7 // items that were unable to be processed because of errors. |
| 8 // | 8 // |
| 9 // THIS CLASS PROVIDES NO SYNCHRONIZATION GUARANTEES. | 9 // THIS CLASS PROVIDES NO SYNCHRONIZATION GUARANTEES. |
| 10 | 10 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 | 147 |
| 148 void set_commit_ids(const std::vector<syncable::Id>& commit_ids) { | 148 void set_commit_ids(const std::vector<syncable::Id>& commit_ids) { |
| 149 sync_cycle_state_->set_commit_ids(commit_ids); | 149 sync_cycle_state_->set_commit_ids(commit_ids); |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool commit_ids_empty() const { | 152 bool commit_ids_empty() const { |
| 153 return sync_cycle_state_->commit_ids_empty(); | 153 return sync_cycle_state_->commit_ids_empty(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool HadSuccessfulCommits() const { |
| 157 return sync_process_state_->successful_commits() > 0; |
| 158 } |
| 159 |
| 156 syncable::WriteTransaction* write_transaction() const { | 160 syncable::WriteTransaction* write_transaction() const { |
| 157 return sync_cycle_state_->write_transaction(); | 161 return sync_cycle_state_->write_transaction(); |
| 158 } | 162 } |
| 159 | 163 |
| 160 bool has_open_write_transaction() const { | 164 bool has_open_write_transaction() const { |
| 161 return sync_cycle_state_->has_open_write_transaction(); | 165 return sync_cycle_state_->has_open_write_transaction(); |
| 162 } | 166 } |
| 163 | 167 |
| 164 ClientToServerMessage* commit_message() const { | 168 ClientToServerMessage* commit_message() const { |
| 165 return sync_cycle_state_->commit_message(); | 169 return sync_cycle_state_->commit_message(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 // True if notifications are enabled when this session was created. | 358 // True if notifications are enabled when this session was created. |
| 355 bool notifications_enabled_; | 359 bool notifications_enabled_; |
| 356 | 360 |
| 357 FRIEND_TEST(SyncerTest, TestCommitListOrderingCounterexample); | 361 FRIEND_TEST(SyncerTest, TestCommitListOrderingCounterexample); |
| 358 DISALLOW_COPY_AND_ASSIGN(SyncerSession); | 362 DISALLOW_COPY_AND_ASSIGN(SyncerSession); |
| 359 }; | 363 }; |
| 360 | 364 |
| 361 } // namespace browser_sync | 365 } // namespace browser_sync |
| 362 | 366 |
| 363 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_SESSION_H_ | 367 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_SESSION_H_ |
| OLD | NEW |