| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "sync/engine/store_timestamps_command.h" | 5 #include "sync/engine/store_timestamps_command.h" |
| 6 | 6 |
| 7 #include "sync/internal_api/public/base/model_type.h" | 7 #include "sync/internal_api/public/base/model_type.h" |
| 8 #include "sync/sessions/status_controller.h" | 8 #include "sync/sessions/status_controller.h" |
| 9 #include "sync/sessions/sync_session.h" | 9 #include "sync/sessions/sync_session.h" |
| 10 #include "sync/syncable/directory.h" | 10 #include "sync/syncable/directory.h" |
| 11 | 11 |
| 12 namespace syncer { | 12 namespace syncer { |
| 13 | 13 |
| 14 StoreTimestampsCommand::StoreTimestampsCommand() {} | 14 StoreTimestampsCommand::StoreTimestampsCommand() {} |
| 15 StoreTimestampsCommand::~StoreTimestampsCommand() {} | 15 StoreTimestampsCommand::~StoreTimestampsCommand() {} |
| 16 | 16 |
| 17 SyncerError StoreTimestampsCommand::ExecuteImpl( | 17 SyncerError StoreTimestampsCommand::ExecuteImpl( |
| 18 sessions::SyncSession* session) { | 18 sessions::SyncSession* session) { |
| 19 syncable::Directory* dir = session->context()->directory(); | 19 syncable::Directory* dir = session->context()->directory(); |
| 20 | 20 |
| 21 const GetUpdatesResponse& updates = | 21 const sync_pb::GetUpdatesResponse& updates = |
| 22 session->status_controller().updates_response().get_updates(); | 22 session->status_controller().updates_response().get_updates(); |
| 23 | 23 |
| 24 sessions::StatusController* status = session->mutable_status_controller(); | 24 sessions::StatusController* status = session->mutable_status_controller(); |
| 25 | 25 |
| 26 // Update the progress marker tokens from the server result. If a marker | 26 // Update the progress marker tokens from the server result. If a marker |
| 27 // was omitted for any one type, that indicates no change from the previous | 27 // was omitted for any one type, that indicates no change from the previous |
| 28 // state. | 28 // state. |
| 29 syncer::ModelTypeSet forward_progress_types; | 29 syncer::ModelTypeSet forward_progress_types; |
| 30 for (int i = 0; i < updates.new_progress_marker_size(); ++i) { | 30 for (int i = 0; i < updates.new_progress_marker_size(); ++i) { |
| 31 syncer::ModelType model = | 31 syncer::ModelType model = |
| (...skipping 18 matching lines...) Expand all Loading... |
| 50 if (updates.has_changes_remaining()) { | 50 if (updates.has_changes_remaining()) { |
| 51 int64 changes_left = updates.changes_remaining(); | 51 int64 changes_left = updates.changes_remaining(); |
| 52 DVLOG(1) << "Changes remaining: " << changes_left; | 52 DVLOG(1) << "Changes remaining: " << changes_left; |
| 53 status->set_num_server_changes_remaining(changes_left); | 53 status->set_num_server_changes_remaining(changes_left); |
| 54 } | 54 } |
| 55 | 55 |
| 56 return SYNCER_OK; | 56 return SYNCER_OK; |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace syncer | 59 } // namespace syncer |
| OLD | NEW |