diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 17:01:10 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 17:01:10 +0000 |
commit | 990fd0f027e68083b0be9024fb2a2abc93ddbdc1 (patch) | |
tree | 5d2a29b4c25cf8a7c06ee72e4a8f31ec9f46b99a /chrome/browser/sync | |
parent | fb8299b6e2897836c8fd927f21eb9f57a805d06d (diff) | |
download | chromium_src-990fd0f027e68083b0be9024fb2a2abc93ddbdc1.zip chromium_src-990fd0f027e68083b0be9024fb2a2abc93ddbdc1.tar.gz chromium_src-990fd0f027e68083b0be9024fb2a2abc93ddbdc1.tar.bz2 |
Make two members private in sync and add getters/setters for them.
BUG=None
TEST=None
Patch by Thiago Farina, http://codereview.chromium.org/242017
Review URL: http://codereview.chromium.org/251029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/engine/conflict_resolution_view.cc | 6 | ||||
-rw-r--r-- | chrome/browser/sync/engine/sync_process_state.cc | 15 | ||||
-rw-r--r-- | chrome/browser/sync/engine/sync_process_state.h | 14 | ||||
-rw-r--r-- | chrome/browser/sync/engine/syncer_session.h | 4 |
4 files changed, 30 insertions, 9 deletions
diff --git a/chrome/browser/sync/engine/conflict_resolution_view.cc b/chrome/browser/sync/engine/conflict_resolution_view.cc index 0b672a1..1ea2d5e 100644 --- a/chrome/browser/sync/engine/conflict_resolution_view.cc +++ b/chrome/browser/sync/engine/conflict_resolution_view.cc @@ -33,15 +33,15 @@ void ConflictResolutionView::set_conflicting_commits(const int val) { } int ConflictResolutionView::num_sync_cycles() const { - return process_state_->num_sync_cycles_; + return process_state_->num_sync_cycles(); } void ConflictResolutionView::increment_num_sync_cycles() { - ++(process_state_->num_sync_cycles_); + process_state_->increment_num_sync_cycles(); } void ConflictResolutionView::zero_num_sync_cycles() { - process_state_->num_sync_cycles_ = 0; + process_state_->set_num_sync_cycles(0); } int64 ConflictResolutionView::current_sync_timestamp() const { diff --git a/chrome/browser/sync/engine/sync_process_state.cc b/chrome/browser/sync/engine/sync_process_state.cc index 6e2e1ad..34028a2 100644 --- a/chrome/browser/sync/engine/sync_process_state.cc +++ b/chrome/browser/sync/engine/sync_process_state.cc @@ -131,6 +131,21 @@ SyncProcessState& SyncProcessState::operator=(const SyncProcessState& counts) { return *this; } +void SyncProcessState::set_num_sync_cycles(const int val) { + UpdateDirty(val != num_sync_cycles_); + num_sync_cycles_ = val; +} + +void SyncProcessState::increment_num_sync_cycles() { + UpdateDirty(true); + ++num_sync_cycles_; +} + +void SyncProcessState::set_silenced_until(const time_t val) { + UpdateDirty(val != silenced_until_); + silenced_until_ = val; +} + // Status maintenance functions. void SyncProcessState::set_invalid_store(const bool val) { UpdateDirty(val != invalid_store_); diff --git a/chrome/browser/sync/engine/sync_process_state.h b/chrome/browser/sync/engine/sync_process_state.h index 528fb45..3fbcf89 100644 --- a/chrome/browser/sync/engine/sync_process_state.h +++ b/chrome/browser/sync/engine/sync_process_state.h @@ -180,11 +180,12 @@ class SyncProcessState { // Assorted other state info. int conflicting_updates() const { return conflicting_item_ids_.size(); } - // TODO(sync): make these two members private and add getters/setters. - int num_sync_cycles_; + int num_sync_cycles() const { return num_sync_cycles_; } + void set_num_sync_cycles(const int val); + void increment_num_sync_cycles(); - // When we're over bandwidth quota, we don't update until past this time. - time_t silenced_until_; + time_t silenced_until() const { return silenced_until_; } + void set_silenced_until(const time_t val); // Info that is tracked purely for status reporting. @@ -331,6 +332,11 @@ class SyncProcessState { std::map<syncable::Id, ConflictSet*> id_to_conflict_set_; std::set<ConflictSet*> conflict_sets_; + int num_sync_cycles_; + + // When we're over bandwidth quota, we don't update until past this time. + time_t silenced_until_; + // Status information, as opposed to state info that may also be exposed for // status reporting purposes. static const int ERROR_THRESHOLD = 500; diff --git a/chrome/browser/sync/engine/syncer_session.h b/chrome/browser/sync/engine/syncer_session.h index 4e1ff26..6fc22ed 100644 --- a/chrome/browser/sync/engine/syncer_session.h +++ b/chrome/browser/sync/engine/syncer_session.h @@ -124,11 +124,11 @@ class SyncerSession { } time_t silenced_until() const { - return sync_process_state_->silenced_until_; + return sync_process_state_->silenced_until(); } void set_silenced_until(time_t silenced_until) const { - sync_process_state_->silenced_until_ = silenced_until; + sync_process_state_->set_silenced_until(silenced_until); } const std::vector<int64>& unsynced_handles() const { |