diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 01:32:19 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 01:32:19 +0000 |
commit | 1fa528658d43f7e3fa7651a423430d11dc90d4bc (patch) | |
tree | 44e78fc3423db8cbe8384497bd1ad771173b0c00 | |
parent | 3fa65fc215c6b5c0a4f71db51627d24d6dff5188 (diff) | |
download | chromium_src-1fa528658d43f7e3fa7651a423430d11dc90d4bc.zip chromium_src-1fa528658d43f7e3fa7651a423430d11dc90d4bc.tar.gz chromium_src-1fa528658d43f7e3fa7651a423430d11dc90d4bc.tar.bz2 |
Removes blocked items. Also, some minor cleanup in preparation for (and to help minimize diffs from) a larger CL.
(Cloned from http://codereview.chromium.org/371071, which was part of an http:// checkout,
and this one is an svn:// checkout, so that I can commit).
BUG=25266
Review URL: http://codereview.chromium.org/371092
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31528 0039d316-1c4b-4281-b951-d872f2087c98
18 files changed, 8 insertions, 317 deletions
diff --git a/chrome/browser/sync/engine/all_status.cc b/chrome/browser/sync/engine/all_status.cc index a6087b6..fb1ef44f 100644 --- a/chrome/browser/sync/engine/all_status.cc +++ b/chrome/browser/sync/engine/all_status.cc @@ -217,9 +217,9 @@ void AllStatus::HandleAuthWatcherEvent(const AuthWatcherEvent& auth_event) { void AllStatus::HandleSyncerEvent(const SyncerEvent& event) { ScopedStatusLockWithNotify lock(this); switch (event.what_happened) { - case SyncerEvent::SYNC_CYCLE_ENDED: case SyncerEvent::COMMITS_SUCCEEDED: break; + case SyncerEvent::SYNC_CYCLE_ENDED: case SyncerEvent::STATUS_CHANGED: status_ = CalcSyncing(event); break; diff --git a/chrome/browser/sync/engine/apply_updates_command_unittest.cc b/chrome/browser/sync/engine/apply_updates_command_unittest.cc index aff2c63..795ca00 100644 --- a/chrome/browser/sync/engine/apply_updates_command_unittest.cc +++ b/chrome/browser/sync/engine/apply_updates_command_unittest.cc @@ -77,8 +77,6 @@ TEST_F(ApplyUpdatesCommandTest, Simple) { << "All updates should have been attempted"; EXPECT_EQ(0, process_state.ConflictingItemsSize()) << "Simple update shouldn't result in conflicts"; - EXPECT_EQ(0, process_state.BlockedItemsSize()) - << "Blocked items shouldn't be possible under any circumstances"; EXPECT_EQ(2, cycle_state.SuccessfullyAppliedUpdateCount()) << "All items should have been successfully applied"; } @@ -104,8 +102,6 @@ TEST_F(ApplyUpdatesCommandTest, UpdateWithChildrenBeforeParents) { << "All updates should have been attempted"; EXPECT_EQ(0, process_state.ConflictingItemsSize()) << "Simple update shouldn't result in conflicts, even if out-of-order"; - EXPECT_EQ(0, process_state.BlockedItemsSize()) - << "Blocked items shouldn't be possible under any circumstances"; EXPECT_EQ(5, cycle_state.SuccessfullyAppliedUpdateCount()) << "All updates should have been successfully applied"; } @@ -126,8 +122,6 @@ TEST_F(ApplyUpdatesCommandTest, NestedItemsWithUnknownParent) { << "All updates should have been attempted"; EXPECT_EQ(2, process_state.ConflictingItemsSize()) << "All updates with an unknown ancestors should be in conflict"; - EXPECT_EQ(0, process_state.BlockedItemsSize()) - << "Blocked items shouldn't be possible under any circumstances"; EXPECT_EQ(0, cycle_state.SuccessfullyAppliedUpdateCount()) << "No item with an unknown ancestor should be applied"; } @@ -153,8 +147,6 @@ TEST_F(ApplyUpdatesCommandTest, ItemsBothKnownAndUnknown) { << "All updates should have been attempted"; EXPECT_EQ(2, process_state.ConflictingItemsSize()) << "The updates with unknown ancestors should be in conflict"; - EXPECT_EQ(0, process_state.BlockedItemsSize()) - << "Blocked items shouldn't be possible under any circumstances"; EXPECT_EQ(4, cycle_state.SuccessfullyAppliedUpdateCount()) << "The updates with known ancestors should be successfully applied"; } diff --git a/chrome/browser/sync/engine/conflict_resolution_view.cc b/chrome/browser/sync/engine/conflict_resolution_view.cc index 07daf9a..e4e8620 100644 --- a/chrome/browser/sync/engine/conflict_resolution_view.cc +++ b/chrome/browser/sync/engine/conflict_resolution_view.cc @@ -32,18 +32,6 @@ void ConflictResolutionView::set_conflicting_commits(const int val) { process_state_->set_conflicting_commits(val); } -int ConflictResolutionView::num_sync_cycles() const { - return process_state_->num_sync_cycles(); -} - -void ConflictResolutionView::increment_num_sync_cycles() { - process_state_->increment_num_sync_cycles(); -} - -void ConflictResolutionView::zero_num_sync_cycles() { - process_state_->set_num_sync_cycles(0); -} - int64 ConflictResolutionView::current_sync_timestamp() const { return process_state_->current_sync_timestamp(); } @@ -114,53 +102,27 @@ bool ConflictResolutionView::HasCommitConflicts() const { return process_state_->HasConflictingItems(); } -bool ConflictResolutionView::HasBlockedItems() const { - return process_state_->HasBlockedItems(); -} - int ConflictResolutionView::CommitConflictsSize() const { return process_state_->ConflictingItemsSize(); } -int ConflictResolutionView::BlockedItemsSize() const { - return process_state_->BlockedItemsSize(); -} - void ConflictResolutionView::AddCommitConflict(const syncable::Id& the_id) { process_state_->AddConflictingItem(the_id); } -void ConflictResolutionView::AddBlockedItem(const syncable::Id& the_id) { - process_state_->AddBlockedItem(the_id); -} - void ConflictResolutionView::EraseCommitConflict( set<syncable::Id>::iterator it) { process_state_->EraseConflictingItem(it); } -void ConflictResolutionView::EraseBlockedItem( - set<syncable::Id>::iterator it) { - process_state_->EraseBlockedItem(it); -} - set<syncable::Id>::iterator ConflictResolutionView::CommitConflictsBegin() const { return process_state_->ConflictingItemsBegin(); } set<syncable::Id>::iterator -ConflictResolutionView::BlockedItemsBegin() const { - return process_state_->BlockedItemsBegin(); -} - -set<syncable::Id>::iterator ConflictResolutionView::CommitConflictsEnd() const { return process_state_->ConflictingItemsEnd(); } -set<syncable::Id>::iterator ConflictResolutionView::BlockedItemsEnd() const { - return process_state_->BlockedItemsEnd(); -} - } // namespace browser_sync diff --git a/chrome/browser/sync/engine/conflict_resolution_view.h b/chrome/browser/sync/engine/conflict_resolution_view.h index 2e1b9b5..e349d3e 100644 --- a/chrome/browser/sync/engine/conflict_resolution_view.h +++ b/chrome/browser/sync/engine/conflict_resolution_view.h @@ -52,12 +52,6 @@ class ConflictResolutionView { void set_conflicting_commits(const int val); - int num_sync_cycles() const; - - void increment_num_sync_cycles(); - - void zero_num_sync_cycles(); - // True iff we're stuck. Something has gone wrong with the syncer. bool syncer_stuck() const; @@ -90,28 +84,16 @@ class ConflictResolutionView { bool HasCommitConflicts() const; - bool HasBlockedItems() const; - int CommitConflictsSize() const; - int BlockedItemsSize() const; - void AddCommitConflict(const syncable::Id& the_id); - void AddBlockedItem(const syncable::Id& the_id); - void EraseCommitConflict(std::set<syncable::Id>::iterator it); - void EraseBlockedItem(std::set<syncable::Id>::iterator it); - std::set<syncable::Id>::iterator CommitConflictsBegin() const; - std::set<syncable::Id>::iterator BlockedItemsBegin() const; - std::set<syncable::Id>::iterator CommitConflictsEnd() const; - std::set<syncable::Id>::iterator BlockedItemsEnd() const; - private: SyncProcessState* process_state_; diff --git a/chrome/browser/sync/engine/conflict_resolver.cc b/chrome/browser/sync/engine/conflict_resolver.cc index 32a65fa..61eec3c 100644 --- a/chrome/browser/sync/engine/conflict_resolver.cc +++ b/chrome/browser/sync/engine/conflict_resolver.cc @@ -691,11 +691,6 @@ bool ConflictResolver::ResolveSimpleConflicts(const ScopedDirLookup& dir, bool ConflictResolver::ResolveConflicts(const ScopedDirLookup& dir, ConflictResolutionView* view, SyncerSession* session) { - if (view->HasBlockedItems()) { - LOG(INFO) << "Delaying conflict resolution, have " << - view->BlockedItemsSize() << " blocked items."; - return false; - } bool rv = false; if (ResolveSimpleConflicts(dir, view, session)) rv = true; @@ -726,7 +721,6 @@ bool ConflictResolver::ResolveConflicts(const ScopedDirLookup& dir, if (ProcessConflictSet(&trans, conflict_set, conflict_count, session)) { rv = true; } - SyncerStatus status(session); LogAndSignalIfConflictStuck(&trans, conflict_count, conflict_set->begin(), conflict_set->end(), view); diff --git a/chrome/browser/sync/engine/get_commit_ids_command.h b/chrome/browser/sync/engine/get_commit_ids_command.h index 59b737f..4bbae82 100644 --- a/chrome/browser/sync/engine/get_commit_ids_command.h +++ b/chrome/browser/sync/engine/get_commit_ids_command.h @@ -151,9 +151,7 @@ class GetCommitIdsCommand : public SyncerCommand { syncable::GET_BY_HANDLE, metahandle); VerifyCommitResult verify_result = SyncerUtil::ValidateCommitEntry(&entry); - if (verify_result == VERIFY_BLOCKED) { - session_->AddBlockedItem(entry.Get(syncable::ID)); // TODO(chron): Ew. - } else if (verify_result == VERIFY_UNSYNCABLE) { + if (verify_result == VERIFY_UNSYNCABLE) { // Drop unsyncable entries. entry.Put(syncable::IS_UNSYNCED, false); } diff --git a/chrome/browser/sync/engine/process_commit_response_command.cc b/chrome/browser/sync/engine/process_commit_response_command.cc index de993fb..e65a7f1 100644 --- a/chrome/browser/sync/engine/process_commit_response_command.cc +++ b/chrome/browser/sync/engine/process_commit_response_command.cc @@ -133,10 +133,8 @@ void ProcessCommitResponseCommand::ProcessCommitResponse( break; case CommitResponse::OVER_QUOTA: over_quota = true; - // We handle over quota like a retry. + // We handle over quota like a retry, which is same as transient. case CommitResponse::RETRY: - session->AddBlockedItem(commit_ids[i]); - break; case CommitResponse::TRANSIENT_ERROR: ++transient_error_commits; break; @@ -148,7 +146,6 @@ void ProcessCommitResponseCommand::ProcessCommitResponse( // TODO(sync): move status reporting elsewhere. status.set_conflicting_commits(conflicting_commits); - status.set_error_commits(error_commits); if (0 == successes) { status.increment_consecutive_transient_error_commits_by( transient_error_commits); @@ -157,11 +154,6 @@ void ProcessCommitResponseCommand::ProcessCommitResponse( status.zero_consecutive_transient_error_commits(); status.zero_consecutive_errors(); } - // If all commits are errors count it as an error. - if (commit_count == error_commits) { - // A larger error step than normal because a POST just succeeded. - status.TallyBigNewError(); - } if (commit_count != (conflicting_commits + error_commits + transient_error_commits)) { ResetErrorCounters(status); diff --git a/chrome/browser/sync/engine/sync_cycle_state.h b/chrome/browser/sync/engine/sync_cycle_state.h index c134c3a..db82228 100644 --- a/chrome/browser/sync/engine/sync_cycle_state.h +++ b/chrome/browser/sync/engine/sync_cycle_state.h @@ -189,8 +189,6 @@ class SyncCycleState { return over_quota_; } - void set_items_committed(bool b) { items_committed_ = b; } - void set_item_committed() { items_committed_ |= true; } bool items_committed() const { return items_committed_; } diff --git a/chrome/browser/sync/engine/sync_process_state.cc b/chrome/browser/sync/engine/sync_process_state.cc index 15f1464..7fe7415 100644 --- a/chrome/browser/sync/engine/sync_process_state.cc +++ b/chrome/browser/sync/engine/sync_process_state.cc @@ -37,14 +37,12 @@ SyncProcessState::SyncProcessState(syncable::DirectoryManager* dirman, ConflictResolver* const resolver, SyncerEventChannel* syncer_event_channel, ModelSafeWorker* model_safe_worker) - : num_sync_cycles_(0), - connection_manager_(connection_manager), + : connection_manager_(connection_manager), account_name_(account_name), dirman_(dirman), resolver_(resolver), model_safe_worker_(model_safe_worker), syncer_event_channel_(syncer_event_channel), - error_rate_(0), current_sync_timestamp_(0), num_server_changes_remaining_(0), syncing_(false), @@ -52,7 +50,6 @@ SyncProcessState::SyncProcessState(syncable::DirectoryManager* dirman, syncer_stuck_(false), error_commits_(0), conflicting_commits_(0), - stalled_commits_(0), consecutive_problem_get_updates_(0), consecutive_problem_commits_(0), consecutive_transient_error_commits_(0), @@ -76,13 +73,10 @@ SyncProcessState& SyncProcessState::operator=(const SyncProcessState& counts) { return *this; } CleanupSets(); - num_sync_cycles_ = counts.num_sync_cycles_; silenced_until_ = counts.silenced_until_; - error_rate_ = counts.error_rate_; current_sync_timestamp_ = counts.current_sync_timestamp_; num_server_changes_remaining_ = counts.num_server_changes_remaining_; error_commits_ = counts.error_commits_; - stalled_commits_ = counts.stalled_commits_; conflicting_commits_ = counts.conflicting_commits_; consecutive_problem_get_updates_ = counts.consecutive_problem_get_updates_; @@ -92,7 +86,6 @@ SyncProcessState& SyncProcessState::operator=(const SyncProcessState& counts) { counts.consecutive_transient_error_commits_; consecutive_errors_ = counts.consecutive_errors_; conflicting_item_ids_ = counts.conflicting_item_ids_; - blocked_item_ids_ = counts.blocked_item_ids_; successful_commits_ = counts.successful_commits_; syncer_stuck_ = counts.syncer_stuck_; @@ -130,16 +123,6 @@ 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 base::TimeTicks& val) { UpdateDirty(val != silenced_until_); silenced_until_ = val; @@ -181,21 +164,11 @@ void SyncProcessState::set_num_server_changes_remaining(const int64 val) { num_server_changes_remaining_ = val; } -void SyncProcessState::set_error_commits(const int val) { - UpdateDirty(val != error_commits_); - error_commits_ = val; -} - -void SyncProcessState::set_stalled_commits(const int val) { +void SyncProcessState::set_conflicting_commits(const int val) { UpdateDirty(val != conflicting_commits_); conflicting_commits_ = val; } -void SyncProcessState::set_conflicting_commits(const int val) { - UpdateDirty(val != stalled_commits_); - stalled_commits_ = val; -} - // WEIRD COUNTER functions. void SyncProcessState::increment_consecutive_problem_get_updates() { UpdateDirty(true); @@ -248,26 +221,6 @@ void SyncProcessState::zero_successful_commits() { successful_commits_ = 0; } -// Methods for managing error rate tracking. -void SyncProcessState::TallyNewError() { - UpdateDirty(true); - error_rate_ += (65536 - error_rate_) >> 2; -} - -void SyncProcessState::TallyBigNewError() { - UpdateDirty(true); - error_rate_ += (65536 - error_rate_) >> 2; -} - -void SyncProcessState::ForgetOldError() { - error_rate_ -= error_rate_ >> 2; -} - -void SyncProcessState::CheckErrorRateTooHigh() { - UpdateDirty(error_rate_ > ERROR_THRESHOLD); -} - - void SyncProcessState::MergeSets(const syncable::Id& id1, const syncable::Id& id2) { // There are no single item sets, we just leave those entries == 0 @@ -331,10 +284,4 @@ void SyncProcessState::AuthFailed() { auth_failed_ = true; } -void SyncProcessState::AuthSucceeded() { - // Dirty if the last one DID fail. - UpdateAuthDirty(false != auth_failed_); - auth_failed_ = false; -} - } // namespace browser_sync diff --git a/chrome/browser/sync/engine/sync_process_state.h b/chrome/browser/sync/engine/sync_process_state.h index c5db80a..4e63695 100644 --- a/chrome/browser/sync/engine/sync_process_state.h +++ b/chrome/browser/sync/engine/sync_process_state.h @@ -107,84 +107,40 @@ class SyncProcessState { return !conflicting_item_ids_.empty(); } - bool HasBlockedItems() const { - return !blocked_item_ids_.empty(); - } - int ConflictingItemsSize() const { return conflicting_item_ids_.size(); } - int BlockedItemsSize() const { - return blocked_item_ids_.size(); - } - void AddConflictingItem(const syncable::Id& the_id) { std::pair<std::set<syncable::Id>::iterator, bool> ret = conflicting_item_ids_.insert(the_id); UpdateDirty(ret.second); } - void AddBlockedItem(const syncable::Id& the_id) { - std::pair<std::set<syncable::Id>::iterator, bool> ret = - blocked_item_ids_.insert(the_id); - UpdateDirty(ret.second); - } - void EraseConflictingItem(std::set<syncable::Id>::iterator it) { UpdateDirty(true); conflicting_item_ids_.erase(it); } - void EraseBlockedItem(std::set<syncable::Id>::iterator it) { - UpdateDirty(true); - blocked_item_ids_.erase(it); - } - void EraseConflictingItem(const syncable::Id& the_id) { int items_erased = conflicting_item_ids_.erase(the_id); UpdateDirty(0 != items_erased); } - void EraseBlockedItem(const syncable::Id& the_id) { - int items_erased = blocked_item_ids_.erase(the_id); - UpdateDirty(0 != items_erased); - } - std::set<syncable::Id>::iterator ConflictingItemsBegin() { return conflicting_item_ids_.begin(); } - std::set<syncable::Id>::iterator BlockedItemsBegin() { - return blocked_item_ids_.begin(); - } - std::set<syncable::Id>::iterator ConflictingItemsEnd() { return conflicting_item_ids_.end(); } - std::set<syncable::Id>::iterator BlockedItemsEnd() { - return blocked_item_ids_.end(); - } - - void SetConflictingItems(const std::set<syncable::Id>& s) { - UpdateDirty(true); - conflicting_item_ids_ = s; - } - - void SetBlockedItems(const std::set<syncable::Id>& s) { - UpdateDirty(true); - blocked_item_ids_ = s; - } // END item id set manipulation functions // Assorted other state info. + // DEPRECATED: USE ConflictingItemsSize. int conflicting_updates() const { return conflicting_item_ids_.size(); } - int num_sync_cycles() const { return num_sync_cycles_; } - void set_num_sync_cycles(const int val); - void increment_num_sync_cycles(); - base::TimeTicks silenced_until() const { return silenced_until_; } void set_silenced_until(const base::TimeTicks& val); @@ -213,18 +169,10 @@ class SyncProcessState { bool IsShareUsable() const; - int error_commits() const { return error_commits_; } - - void set_error_commits(const int val); - int conflicting_commits() const { return conflicting_commits_; } void set_conflicting_commits(const int val); - int stalled_commits() const { return stalled_commits_; } - - void set_stalled_commits(const int val); - // WEIRD COUNTER manipulation functions. int consecutive_problem_get_updates() const { return consecutive_problem_get_updates_; @@ -263,18 +211,8 @@ class SyncProcessState { void zero_successful_commits(); // end WEIRD COUNTER manipulation functions. - // Methods for managing error rate tracking. - void TallyNewError(); - - void TallyBigNewError(); - - void ForgetOldError(); - - void CheckErrorRateTooHigh(); - // Methods for tracking authentication state. void AuthFailed(); - void AuthSucceeded(); // Returns true if this object has been modified since last SetClean() call. bool IsDirty() const { return dirty_; } @@ -291,22 +229,18 @@ class SyncProcessState { private: // For testing. SyncProcessState() - : num_sync_cycles_(0), - connection_manager_(NULL), + : connection_manager_(NULL), account_name_(PSTR("")), dirman_(NULL), resolver_(NULL), model_safe_worker_(NULL), syncer_event_channel_(NULL), - error_rate_(0), current_sync_timestamp_(0), num_server_changes_remaining_(0), syncing_(false), invalid_store_(false), syncer_stuck_(false), - error_commits_(0), conflicting_commits_(0), - stalled_commits_(0), consecutive_problem_get_updates_(0), consecutive_problem_commits_(0), consecutive_transient_error_commits_(0), @@ -316,8 +250,6 @@ class SyncProcessState { auth_dirty_(false), auth_failed_(false) {} - int num_sync_cycles_; - ServerConnectionManager* connection_manager_; const PathString account_name_; syncable::DirectoryManager* const dirman_; @@ -330,7 +262,6 @@ class SyncProcessState { // TODO(sync): move away from sets if it makes more sense. std::set<syncable::Id> conflicting_item_ids_; - std::set<syncable::Id> blocked_item_ids_; std::map<syncable::Id, ConflictSet*> id_to_conflict_set_; std::set<ConflictSet*> conflict_sets_; @@ -339,8 +270,6 @@ class SyncProcessState { // Status information, as opposed to state info that may also be exposed for // status reporting purposes. - static const int ERROR_THRESHOLD = 500; - int error_rate_; // A EMA in the range [0,65536) int64 current_sync_timestamp_; // During inital sync these two members int64 num_server_changes_remaining_; // Can be used to measure sync progress. @@ -355,7 +284,6 @@ class SyncProcessState { // counts of various commit return values. int error_commits_; int conflicting_commits_; - int stalled_commits_; // WEIRD COUNTERS // Two variables that track the # on consecutive problem requests. diff --git a/chrome/browser/sync/engine/syncer_end_command.cc b/chrome/browser/sync/engine/syncer_end_command.cc index 300f7f4..3ae002d 100644 --- a/chrome/browser/sync/engine/syncer_end_command.cc +++ b/chrome/browser/sync/engine/syncer_end_command.cc @@ -17,8 +17,6 @@ SyncerEndCommand::SyncerEndCommand() {} SyncerEndCommand::~SyncerEndCommand() {} void SyncerEndCommand::ExecuteImpl(SyncerSession* session) { - ConflictResolutionView conflict_view(session); - conflict_view.increment_num_sync_cycles(); SyncerStatus status(session); status.set_syncing(false); diff --git a/chrome/browser/sync/engine/syncer_proto_util.cc b/chrome/browser/sync/engine/syncer_proto_util.cc index 7eb0227..5767d20 100644 --- a/chrome/browser/sync/engine/syncer_proto_util.cc +++ b/chrome/browser/sync/engine/syncer_proto_util.cc @@ -128,12 +128,6 @@ bool SyncerProtoUtil::PostClientToServerMessage(ClientToServerMessage* msg, return false; } - // We use an exponential moving average to determine the rate of errors. - // It's more reactive to recent situations and uses no extra storage. - status.ForgetOldError(); - // If we're decaying send out an update. - status.CheckErrorRateTooHigh(); - switch (response->error_code()) { case ClientToServerResponse::SUCCESS: if (!response->has_store_birthday() && birthday.empty()) { @@ -166,8 +160,6 @@ bool SyncerProtoUtil::PostClientToServerMessage(ClientToServerMessage* msg, break; } - } else if (session->connection_manager()->IsServerReachable()) { - status.TallyNewError(); } return rv; } diff --git a/chrome/browser/sync/engine/syncer_session.h b/chrome/browser/sync/engine/syncer_session.h index 5e4710b..d15f747 100644 --- a/chrome/browser/sync/engine/syncer_session.h +++ b/chrome/browser/sync/engine/syncer_session.h @@ -182,18 +182,10 @@ class SyncerSession { sync_process_state_->AddConflictingItem(the_id); } - void AddBlockedItem(const syncable::Id& the_id) { - sync_process_state_->AddBlockedItem(the_id); - } - void EraseCommitConflict(const syncable::Id& the_id) { sync_process_state_->EraseConflictingItem(the_id); } - void EraseBlockedItem(const syncable::Id& the_id) { - sync_process_state_->EraseBlockedItem(the_id); - } - // Returns true if at least one update application failed due to a conflict // during this sync cycle. bool HasConflictingUpdates() const { @@ -240,24 +232,10 @@ class SyncerSession { LOG(INFO) << sync_cycle_state_->VerifiedUpdatesSize() << " updates verified"; LOG(INFO) << sync_cycle_state_->AppliedUpdatesSize() << " updates applied"; - LOG(INFO) << count_blocked_updates() << " updates blocked by open entry"; LOG(INFO) << commit_ids().size() << " items to commit"; LOG(INFO) << unsynced_count() << " unsynced items"; } - int64 count_blocked_updates() const { - std::vector<AppliedUpdate>::const_iterator it; - int64 count = 0; - for (it = sync_cycle_state_->AppliedUpdatesBegin(); - it < sync_cycle_state_->AppliedUpdatesEnd(); - ++it) { - if (it->first == BLOCKED) { - ++count; - } - } - return count; - } - void set_conflict_sets_built(const bool b) { sync_cycle_state_->set_conflict_sets_built(b); } @@ -278,10 +256,6 @@ class SyncerSession { return sync_process_state_->model_safe_worker(); } - void set_items_committed(const bool b) { - sync_cycle_state_->set_items_committed(b); - } - void set_item_committed() { sync_cycle_state_->set_item_committed(); } diff --git a/chrome/browser/sync/engine/syncer_status.h b/chrome/browser/sync/engine/syncer_status.h index 718985a..cb8d4fb 100644 --- a/chrome/browser/sync/engine/syncer_status.h +++ b/chrome/browser/sync/engine/syncer_status.h @@ -36,10 +36,6 @@ class SyncerStatus { return sync_process_state_->invalid_store(); } - void set_invalid_store(const bool val) { - sync_process_state_->set_invalid_store(val); - } - bool syncer_stuck() const { return sync_process_state_->syncer_stuck(); } @@ -94,22 +90,6 @@ class SyncerStatus { sync_process_state_->set_conflicting_commits(val); } - int BlockedItemsSize() const { - return sync_process_state_->BlockedItemsSize(); - } - - int stalled_updates() const { - return sync_process_state_->BlockedItemsSize(); - } - - int error_commits() const { - return sync_process_state_->error_commits(); - } - - void set_error_commits(const int val) { - sync_process_state_->set_error_commits(val); - } - // WEIRD COUNTER manipulation functions. int consecutive_problem_get_updates() const { return sync_process_state_->consecutive_problem_get_updates(); @@ -179,27 +159,8 @@ class SyncerStatus { bool over_quota() const { return sync_cycle_state_->over_quota(); } - // Methods for managing error rate tracking in sync_process_state. - void TallyNewError() { - sync_process_state_->TallyNewError(); - } - - void TallyBigNewError() { - sync_process_state_->TallyBigNewError(); - } - - void ForgetOldError() { - sync_process_state_->ForgetOldError(); - } - - void CheckErrorRateTooHigh() { - sync_process_state_->CheckErrorRateTooHigh(); - } - void AuthFailed() { sync_process_state_->AuthFailed(); } - void AuthSucceeded() { sync_process_state_->AuthSucceeded(); } - // Returns true if this object has been modified since last SetClean() call. bool IsDirty() const { return sync_cycle_state_->IsDirty() || sync_process_state_->IsDirty(); @@ -231,9 +192,6 @@ class SyncerStatus { LOG(INFO) << "unsynced_count = " << unsynced_count(); LOG(INFO) << "conflicting_updates = " << conflicting_updates(); LOG(INFO) << "conflicting_commits = " << conflicting_commits(); - LOG(INFO) << "BlockedItemsSize = " << BlockedItemsSize(); - LOG(INFO) << "stalled_updates = " << stalled_updates(); - LOG(INFO) << "error_commits = " << error_commits(); LOG(INFO) << "consecutive_problem_get_updates = " << consecutive_problem_get_updates(); diff --git a/chrome/browser/sync/engine/syncer_types.h b/chrome/browser/sync/engine/syncer_types.h index 4a96677..7d8eda4 100644 --- a/chrome/browser/sync/engine/syncer_types.h +++ b/chrome/browser/sync/engine/syncer_types.h @@ -28,10 +28,6 @@ enum UpdateAttemptResponse { // Update was applied or safely ignored. SUCCESS, - // This state is deprecated. - // TODO(sync): Remove this state. - BLOCKED, - // Conflicts with the local data representation. This can also mean that the // entry doesn't currently make sense if we applied it. CONFLICT, @@ -74,7 +70,6 @@ enum VerifyResult { }; enum VerifyCommitResult { - VERIFY_BLOCKED, VERIFY_UNSYNCABLE, VERIFY_OK, }; diff --git a/chrome/browser/sync/engine/syncer_unittest.cc b/chrome/browser/sync/engine/syncer_unittest.cc index 47a67bc..1d6c209 100644 --- a/chrome/browser/sync/engine/syncer_unittest.cc +++ b/chrome/browser/sync/engine/syncer_unittest.cc @@ -1187,7 +1187,6 @@ TEST_F(SyncerTest, TestBasicUpdate) { syncer_->SyncShare(state_.get()); SyncerStatus status(NULL, state_.get()); - EXPECT_TRUE(0 == status.stalled_updates()); { WriteTransaction trans(dir, UNITTEST, __FILE__, __LINE__); Entry entry(&trans, GET_BY_ID, @@ -1226,7 +1225,6 @@ TEST_F(SyncerTest, IllegalAndLegalUpdates) { SyncerStatus status(NULL, state_.get()); // Ids 2 and 3 are expected to be in conflict now. EXPECT_TRUE(2 == conflict_view.conflicting_updates()); - EXPECT_TRUE(0 == status.stalled_updates()); // These entries will be used in the second set of updates. mock_server_->AddUpdateDirectory(4, 0, "newer_version", 20, 10); @@ -1240,7 +1238,6 @@ TEST_F(SyncerTest, IllegalAndLegalUpdates) { // The three items with an unresolved parent should be unapplied (3, 9, 100). // The name clash should also still be in conflict. EXPECT_TRUE(4 == conflict_view.conflicting_updates()); - EXPECT_TRUE(0 == status.stalled_updates()); { WriteTransaction trans(dir, UNITTEST, __FILE__, __LINE__); Entry name_clash(&trans, GET_BY_ID, ids_.FromNumber(2)); @@ -2270,9 +2267,7 @@ TEST_F(SyncerTest, DeletingEntryInFolder) { } syncer_->SyncShare(state_.get()); SyncerStatus status(NULL, state_.get()); - EXPECT_TRUE(0 == status.error_commits()); EXPECT_TRUE(0 == status.conflicting_commits()); - EXPECT_TRUE(0 == status.BlockedItemsSize()); } // TODO(sync): Is this test useful anymore? diff --git a/chrome/browser/sync/engine/update_applicator.cc b/chrome/browser/sync/engine/update_applicator.cc index 8c5db40..d0ff392 100644 --- a/chrome/browser/sync/engine/update_applicator.cc +++ b/chrome/browser/sync/engine/update_applicator.cc @@ -44,7 +44,6 @@ bool UpdateApplicator::AttemptOneApplication( // Clear the tracked failures to avoid double-counting. conflicting_ids_.clear(); - blocked_ids_.clear(); } syncable::MutableEntry entry(trans, syncable::GET_BY_HANDLE, *pointer_); UpdateAttemptResponse updateResponse = @@ -60,10 +59,6 @@ bool UpdateApplicator::AttemptOneApplication( pointer_++; conflicting_ids_.push_back(entry.Get(syncable::ID)); break; - case BLOCKED: - pointer_++; - blocked_ids_.push_back(entry.Get(syncable::ID)); - break; default: NOTREACHED(); break; @@ -75,8 +70,7 @@ bool UpdateApplicator::AttemptOneApplication( } bool UpdateApplicator::AllUpdatesApplied() const { - return conflicting_ids_.empty() && blocked_ids_.empty() && - begin_ == end_; + return conflicting_ids_.empty() && begin_ == end_; } void UpdateApplicator::SaveProgressIntoSessionState(SyncerSession* session) { @@ -85,18 +79,11 @@ void UpdateApplicator::SaveProgressIntoSessionState(SyncerSession* session) { vector<syncable::Id>::const_iterator i; for (i = conflicting_ids_.begin(); i != conflicting_ids_.end(); ++i) { - session->EraseBlockedItem(*i); session->AddCommitConflict(*i); session->AddAppliedUpdate(CONFLICT, *i); } - for (i = blocked_ids_.begin(); i != blocked_ids_.end(); ++i) { - session->AddBlockedItem(*i); - session->EraseCommitConflict(*i); - session->AddAppliedUpdate(BLOCKED, *i); - } for (i = successful_ids_.begin(); i != successful_ids_.end(); ++i) { session->EraseCommitConflict(*i); - session->EraseBlockedItem(*i); session->AddAppliedUpdate(SUCCESS, *i); } } diff --git a/chrome/browser/sync/engine/update_applicator.h b/chrome/browser/sync/engine/update_applicator.h index dd65639..dc27e17 100644 --- a/chrome/browser/sync/engine/update_applicator.h +++ b/chrome/browser/sync/engine/update_applicator.h @@ -54,7 +54,6 @@ class UpdateApplicator { // Track the result of the various items. std::vector<syncable::Id> conflicting_ids_; - std::vector<syncable::Id> blocked_ids_; std::vector<syncable::Id> successful_ids_; }; |