diff options
Diffstat (limited to 'sync')
-rw-r--r-- | sync/engine/all_status.cc | 3 | ||||
-rw-r--r-- | sync/engine/get_updates_processor.cc | 12 | ||||
-rw-r--r-- | sync/internal_api/public/engine/sync_status.cc | 1 | ||||
-rw-r--r-- | sync/internal_api/public/engine/sync_status.h | 2 | ||||
-rw-r--r-- | sync/internal_api/public/sessions/model_neutral_state.cc | 3 | ||||
-rw-r--r-- | sync/internal_api/public/sessions/model_neutral_state.h | 5 | ||||
-rw-r--r-- | sync/internal_api/public/sessions/sync_session_snapshot.cc | 7 | ||||
-rw-r--r-- | sync/internal_api/public/sessions/sync_session_snapshot.h | 1 | ||||
-rw-r--r-- | sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc | 5 | ||||
-rw-r--r-- | sync/sessions/status_controller.cc | 5 | ||||
-rw-r--r-- | sync/sessions/status_controller.h | 6 | ||||
-rw-r--r-- | sync/sessions/status_controller_unittest.cc | 2 | ||||
-rw-r--r-- | sync/sessions/test_util.cc | 4 |
13 files changed, 8 insertions, 48 deletions
diff --git a/sync/engine/all_status.cc b/sync/engine/all_status.cc index 3deda48..5a2f616 100644 --- a/sync/engine/all_status.cc +++ b/sync/engine/all_status.cc @@ -32,7 +32,6 @@ SyncStatus AllStatus::CreateBlankStatus() const { status.hierarchy_conflicts = 0; status.server_conflicts = 0; status.committed_count = 0; - status.updates_available = 0; return status; } @@ -51,8 +50,6 @@ SyncStatus AllStatus::CalcSyncing(const SyncCycleEvent &event) const { status.syncing = false; } - status.updates_available += snapshot.num_server_changes_remaining(); - status.num_entries_by_type = snapshot.num_entries_by_type(); status.num_to_delete_entries_by_type = snapshot.num_to_delete_entries_by_type(); diff --git a/sync/engine/get_updates_processor.cc b/sync/engine/get_updates_processor.cc index 8666e0a..79be6c8 100644 --- a/sync/engine/get_updates_processor.cc +++ b/sync/engine/get_updates_processor.cc @@ -241,11 +241,10 @@ SyncerError GetUpdatesProcessor::ExecuteDownloadUpdates( return result; } - DVLOG(1) << "GetUpdates " - << " returned " << update_response.get_updates().entries_size() - << " updates and indicated " - << update_response.get_updates().changes_remaining() - << " updates left on server."; + DVLOG(1) << "GetUpdates returned " + << update_response.get_updates().entries_size() + << " updates."; + if (session->context()->debug_info_getter()) { // Clear debug info now that we have successfully sent it to the server. @@ -268,6 +267,8 @@ SyncerError GetUpdatesProcessor::ExecuteDownloadUpdates( base::Time::Now(), update_response, process_result); session->SendProtocolEvent(response_event); + DVLOG(1) << "GetUpdates result: " << process_result; + return process_result; } @@ -282,7 +283,6 @@ SyncerError GetUpdatesProcessor::ProcessResponse( if (!gu_response.has_changes_remaining()) { return SERVER_RESPONSE_VALIDATION_FAILED; } - status->set_num_server_changes_remaining(gu_response.changes_remaining()); syncer::SyncerError result = ProcessGetUpdatesResponse(request_types, gu_response, status); diff --git a/sync/internal_api/public/engine/sync_status.cc b/sync/internal_api/public/engine/sync_status.cc index b1687e3..6ac894e 100644 --- a/sync/internal_api/public/engine/sync_status.cc +++ b/sync/internal_api/public/engine/sync_status.cc @@ -14,7 +14,6 @@ SyncStatus::SyncStatus() server_conflicts(0), committed_count(0), syncing(false), - updates_available(0), updates_received(0), reflected_updates_received(0), tombstone_updates_received(0), diff --git a/sync/internal_api/public/engine/sync_status.h b/sync/internal_api/public/engine/sync_status.h index c32be00..1c284ce 100644 --- a/sync/internal_api/public/engine/sync_status.h +++ b/sync/internal_api/public/engine/sync_status.h @@ -49,8 +49,6 @@ struct SYNC_EXPORT SyncStatus { bool syncing; - // Total updates available. If zero, nothing left to download. - int64 updates_available; // Total updates received by the syncer since browser start. int updates_received; // Total updates received that are echoes of our own changes. diff --git a/sync/internal_api/public/sessions/model_neutral_state.cc b/sync/internal_api/public/sessions/model_neutral_state.cc index fa2b019..37d0174 100644 --- a/sync/internal_api/public/sessions/model_neutral_state.cc +++ b/sync/internal_api/public/sessions/model_neutral_state.cc @@ -22,8 +22,7 @@ ModelNeutralState::ModelNeutralState() last_get_key_result(UNSET), last_download_updates_result(UNSET), commit_result(UNSET), - items_committed(false), - num_server_changes_remaining(0) { + items_committed(false) { } ModelNeutralState::~ModelNeutralState() {} diff --git a/sync/internal_api/public/sessions/model_neutral_state.h b/sync/internal_api/public/sessions/model_neutral_state.h index d85d039..8d97f89 100644 --- a/sync/internal_api/public/sessions/model_neutral_state.h +++ b/sync/internal_api/public/sessions/model_neutral_state.h @@ -53,11 +53,6 @@ struct SYNC_EXPORT ModelNeutralState { // Set to true by PostCommitMessageCommand if any commits were successful. bool items_committed; - - // Number of changes remaining, according to the server. - // Take it as an estimate unless it's value is zero, in which case there - // really is nothing more to download. - int64 num_server_changes_remaining; }; bool HasSyncerError(const ModelNeutralState& state); diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.cc b/sync/internal_api/public/sessions/sync_session_snapshot.cc index 97bc094..4e7a2b1 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.cc +++ b/sync/internal_api/public/sessions/sync_session_snapshot.cc @@ -70,9 +70,6 @@ base::DictionaryValue* SyncSessionSnapshot::ToValue() const { model_neutral_state_.num_local_overwrites); value->SetInteger("numServerOverwrites", model_neutral_state_.num_server_overwrites); - value->SetInteger( - "numServerChangesRemaining", - static_cast<int>(model_neutral_state_.num_server_changes_remaining)); value->Set("downloadProgressMarkers", ProgressMarkerMapToValue(download_progress_markers_).release()); value->SetBoolean("isSilenced", is_silenced_); @@ -112,10 +109,6 @@ std::string SyncSessionSnapshot::ToString() const { return json; } -int64 SyncSessionSnapshot::num_server_changes_remaining() const { - return model_neutral_state().num_server_changes_remaining; -} - const ProgressMarkerMap& SyncSessionSnapshot::download_progress_markers() const { return download_progress_markers_; diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.h b/sync/internal_api/public/sessions/sync_session_snapshot.h index 97a97aa..a764de1 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.h +++ b/sync/internal_api/public/sessions/sync_session_snapshot.h @@ -52,7 +52,6 @@ class SYNC_EXPORT SyncSessionSnapshot { ModelNeutralState model_neutral_state() const { return model_neutral_state_; } - int64 num_server_changes_remaining() const; const ProgressMarkerMap& download_progress_markers() const; bool is_silenced() const; int num_encryption_conflicts() const; diff --git a/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc b/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc index 881ab01..d19a69c 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc +++ b/sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc @@ -23,7 +23,6 @@ class SyncSessionSnapshotTest : public testing::Test {}; TEST_F(SyncSessionSnapshotTest, SyncSessionSnapshotToValue) { ModelNeutralState model_neutral; - model_neutral.num_server_changes_remaining = 105; model_neutral.num_successful_commits = 5; model_neutral.num_successful_bookmark_commits = 10; model_neutral.num_updates_downloaded_total = 100; @@ -56,7 +55,7 @@ TEST_F(SyncSessionSnapshotTest, SyncSessionSnapshotToValue) { std::vector<int>(MODEL_TYPE_COUNT, 0), sync_pb::GetUpdatesCallerInfo::UNKNOWN); scoped_ptr<base::DictionaryValue> value(snapshot.ToValue()); - EXPECT_EQ(17u, value->size()); + EXPECT_EQ(16u, value->size()); ExpectDictIntegerValue(model_neutral.num_successful_commits, *value, "numSuccessfulCommits"); ExpectDictIntegerValue(model_neutral.num_successful_bookmark_commits, @@ -71,8 +70,6 @@ TEST_F(SyncSessionSnapshotTest, SyncSessionSnapshotToValue) { *value, "numLocalOverwrites"); ExpectDictIntegerValue(model_neutral.num_server_overwrites, *value, "numServerOverwrites"); - ExpectDictIntegerValue(model_neutral.num_server_changes_remaining, - *value, "numServerChangesRemaining"); ExpectDictDictionaryValue(*expected_download_progress_markers_value, *value, "downloadProgressMarkers"); ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced"); diff --git a/sync/sessions/status_controller.cc b/sync/sessions/status_controller.cc index 666504f..4610a51 100644 --- a/sync/sessions/status_controller.cc +++ b/sync/sessions/status_controller.cc @@ -32,11 +32,6 @@ void StatusController::increment_num_reflected_updates_downloaded_by( model_neutral_.num_reflected_updates_downloaded_total += value; } -void StatusController::set_num_server_changes_remaining( - int64 changes_remaining) { - model_neutral_.num_server_changes_remaining = changes_remaining; -} - void StatusController::UpdateStartTime() { sync_start_time_ = base::Time::Now(); } diff --git a/sync/sessions/status_controller.h b/sync/sessions/status_controller.h index 51fa3ce..9844929 100644 --- a/sync/sessions/status_controller.h +++ b/sync/sessions/status_controller.h @@ -43,11 +43,6 @@ class SYNC_EXPORT_PRIVATE StatusController { model_neutral_.commit_request_types = value; } - // Changelog related state. - int64 num_server_changes_remaining() const { - return model_neutral_.num_server_changes_remaining; - } - // Various conflict counters. int num_encryption_conflicts() const; int num_hierarchy_conflicts() const; @@ -73,7 +68,6 @@ class SYNC_EXPORT_PRIVATE StatusController { SyncerError last_get_key_result() const; // Download counters. - void set_num_server_changes_remaining(int64 changes_remaining); void increment_num_updates_downloaded_by(int value); void increment_num_tombstone_updates_downloaded_by(int value); void increment_num_reflected_updates_downloaded_by(int value); diff --git a/sync/sessions/status_controller_unittest.cc b/sync/sessions/status_controller_unittest.cc index c29bc5f..56bc987 100644 --- a/sync/sessions/status_controller_unittest.cc +++ b/sync/sessions/status_controller_unittest.cc @@ -16,8 +16,6 @@ class StatusControllerTest : public testing::Test { }; // method was actually setting |bar_| instead!). TEST_F(StatusControllerTest, ReadYourWrites) { StatusController status; - status.set_num_server_changes_remaining(13); - EXPECT_EQ(13, status.num_server_changes_remaining()); status.set_last_download_updates_result(SYNCER_OK); EXPECT_EQ(SYNCER_OK, diff --git a/sync/sessions/test_util.cc b/sync/sessions/test_util.cc index 95db11b..0555d86 100644 --- a/sync/sessions/test_util.cc +++ b/sync/sessions/test_util.cc @@ -22,7 +22,6 @@ void SimulateConfigureSuccess( ModelTypeSet requsted_types, sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, sessions::SyncSession* session) { - ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining()); session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK); session->mutable_status_controller()->set_last_download_updates_result( SYNCER_OK); @@ -49,7 +48,6 @@ void SimulateConfigureConnectionFailure( void SimulateNormalSuccess(ModelTypeSet requested_types, const sessions::NudgeTracker& nudge_tracker, sessions::SyncSession* session) { - ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining()); session->mutable_status_controller()->set_commit_result(SYNCER_OK); session->mutable_status_controller()->set_last_download_updates_result( SYNCER_OK); @@ -83,14 +81,12 @@ void SimulateConnectionFailure( void SimulatePollSuccess(ModelTypeSet requested_types, sessions::SyncSession* session) { - ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining()); session->mutable_status_controller()->set_last_download_updates_result( SYNCER_OK); } void SimulatePollFailed(ModelTypeSet requested_types, sessions::SyncSession* session) { - ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining()); session->mutable_status_controller()->set_last_download_updates_result( SERVER_RETURN_TRANSIENT_ERROR); } |