| 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 "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/model_type.h" | 9 #include "chrome/browser/sync/syncable/model_type.h" |
| 10 #include "chrome/browser/sync/syncable/syncable.h" | 10 #include "chrome/browser/sync/syncable/syncable.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 syncable::ModelTypeSet forward_progress_types; | 29 syncable::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 syncable::ModelType model = | 31 syncable::ModelType model = |
| 32 syncable::GetModelTypeFromExtensionFieldNumber( | 32 syncable::GetModelTypeFromSpecificsFieldNumber( |
| 33 updates.new_progress_marker(i).data_type_id()); | 33 updates.new_progress_marker(i).data_type_id()); |
| 34 if (model == syncable::UNSPECIFIED || model == syncable::TOP_LEVEL_FOLDER) { | 34 if (model == syncable::UNSPECIFIED || model == syncable::TOP_LEVEL_FOLDER) { |
| 35 NOTREACHED() << "Unintelligible server response."; | 35 NOTREACHED() << "Unintelligible server response."; |
| 36 continue; | 36 continue; |
| 37 } | 37 } |
| 38 forward_progress_types.Put(model); | 38 forward_progress_types.Put(model); |
| 39 dir->SetDownloadProgress(model, updates.new_progress_marker(i)); | 39 dir->SetDownloadProgress(model, updates.new_progress_marker(i)); |
| 40 } | 40 } |
| 41 DCHECK(!forward_progress_types.Empty() || | 41 DCHECK(!forward_progress_types.Empty() || |
| 42 updates.changes_remaining() == 0); | 42 updates.changes_remaining() == 0); |
| 43 if (VLOG_IS_ON(1)) { | 43 if (VLOG_IS_ON(1)) { |
| 44 DVLOG_IF(1, !forward_progress_types.Empty()) | 44 DVLOG_IF(1, !forward_progress_types.Empty()) |
| 45 << "Get Updates got new progress marker for types: " | 45 << "Get Updates got new progress marker for types: " |
| 46 << syncable::ModelTypeSetToString(forward_progress_types) | 46 << syncable::ModelTypeSetToString(forward_progress_types) |
| 47 << " out of possible: " | 47 << " out of possible: " |
| 48 << syncable::ModelTypeSetToString(status->updates_request_types()); | 48 << syncable::ModelTypeSetToString(status->updates_request_types()); |
| 49 } | 49 } |
| 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 browser_sync | 59 } // namespace browser_sync |
| OLD | NEW |