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

Side by Side Diff: chrome/browser/sync/engine/syncer_session.h

Issue 284008: Fix sync bug where notifications were being sent for unsuccessful commit atte... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698