| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/engine/store_timestamps_command.h" | 5 #include "chrome/browser/sync/engine/store_timestamps_command.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/sessions/status_controller.h" | 7 #include "chrome/browser/sync/sessions/status_controller.h" |
| 8 #include "chrome/browser/sync/sessions/sync_session.h" | 8 #include "chrome/browser/sync/sessions/sync_session.h" |
| 9 #include "chrome/browser/sync/syncable/directory_manager.h" | 9 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 10 #include "chrome/browser/sync/syncable/model_type.h" | 10 #include "chrome/browser/sync/syncable/model_type.h" |
| 11 #include "chrome/browser/sync/syncable/syncable.h" | 11 #include "chrome/browser/sync/syncable/syncable.h" |
| 12 | 12 |
| 13 namespace browser_sync { | 13 namespace browser_sync { |
| 14 | 14 |
| 15 StoreTimestampsCommand::StoreTimestampsCommand() {} | 15 StoreTimestampsCommand::StoreTimestampsCommand() {} |
| 16 StoreTimestampsCommand::~StoreTimestampsCommand() {} | 16 StoreTimestampsCommand::~StoreTimestampsCommand() {} |
| 17 | 17 |
| 18 void StoreTimestampsCommand::ExecuteImpl(sessions::SyncSession* session) { | 18 SyncerError StoreTimestampsCommand::ExecuteImpl( |
| 19 sessions::SyncSession* session) { |
| 19 syncable::ScopedDirLookup dir(session->context()->directory_manager(), | 20 syncable::ScopedDirLookup dir(session->context()->directory_manager(), |
| 20 session->context()->account_name()); | 21 session->context()->account_name()); |
| 21 | 22 |
| 22 if (!dir.good()) { | 23 if (!dir.good()) { |
| 23 LOG(ERROR) << "Scoped dir lookup failed!"; | 24 LOG(ERROR) << "Scoped dir lookup failed!"; |
| 24 return; | 25 return DIRECTORY_LOOKUP_FAILED; |
| 25 } | 26 } |
| 26 | 27 |
| 27 const GetUpdatesResponse& updates = | 28 const GetUpdatesResponse& updates = |
| 28 session->status_controller().updates_response().get_updates(); | 29 session->status_controller().updates_response().get_updates(); |
| 29 | 30 |
| 30 sessions::StatusController* status = session->mutable_status_controller(); | 31 sessions::StatusController* status = session->mutable_status_controller(); |
| 31 | 32 |
| 32 // Update the progress marker tokens from the server result. If a marker | 33 // Update the progress marker tokens from the server result. If a marker |
| 33 // was omitted for any one type, that indicates no change from the previous | 34 // was omitted for any one type, that indicates no change from the previous |
| 34 // state. | 35 // state. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 51 << "Get Updates got new progress marker for types: " | 52 << "Get Updates got new progress marker for types: " |
| 52 << syncable::ModelTypeSetToString(forward_progress_types) | 53 << syncable::ModelTypeSetToString(forward_progress_types) |
| 53 << " out of possible: " | 54 << " out of possible: " |
| 54 << syncable::ModelTypeSetToString(status->updates_request_types()); | 55 << syncable::ModelTypeSetToString(status->updates_request_types()); |
| 55 } | 56 } |
| 56 if (updates.has_changes_remaining()) { | 57 if (updates.has_changes_remaining()) { |
| 57 int64 changes_left = updates.changes_remaining(); | 58 int64 changes_left = updates.changes_remaining(); |
| 58 DVLOG(1) << "Changes remaining: " << changes_left; | 59 DVLOG(1) << "Changes remaining: " << changes_left; |
| 59 status->set_num_server_changes_remaining(changes_left); | 60 status->set_num_server_changes_remaining(changes_left); |
| 60 } | 61 } |
| 62 |
| 63 return NO_ERROR; |
| 61 } | 64 } |
| 62 | 65 |
| 63 } // namespace browser_sync | 66 } // namespace browser_sync |
| OLD | NEW |