| 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/download_updates_command.h" | 5 #include "sync/engine/download_updates_command.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "sync/engine/syncer.h" | 10 #include "sync/engine/syncer.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 syncable::Directory* dir = session->context()->directory(); | 40 syncable::Directory* dir = session->context()->directory(); |
| 41 | 41 |
| 42 // Request updates for all enabled types. | 42 // Request updates for all enabled types. |
| 43 const ModelTypeSet enabled_types = | 43 const ModelTypeSet enabled_types = |
| 44 GetRoutingInfoTypes(session->routing_info()); | 44 GetRoutingInfoTypes(session->routing_info()); |
| 45 DVLOG(1) << "Getting updates for types " | 45 DVLOG(1) << "Getting updates for types " |
| 46 << ModelTypeSetToString(enabled_types); | 46 << ModelTypeSetToString(enabled_types); |
| 47 DCHECK(!enabled_types.Empty()); | 47 DCHECK(!enabled_types.Empty()); |
| 48 | 48 |
| 49 const syncer::ModelTypePayloadMap& type_payload_map = | 49 const ModelTypePayloadMap& type_payload_map = session->source().types; |
| 50 session->source().types; | |
| 51 for (ModelTypeSet::Iterator it = enabled_types.First(); | 50 for (ModelTypeSet::Iterator it = enabled_types.First(); |
| 52 it.Good(); it.Inc()) { | 51 it.Good(); it.Inc()) { |
| 53 sync_pb::DataTypeProgressMarker* progress_marker = | 52 sync_pb::DataTypeProgressMarker* progress_marker = |
| 54 get_updates->add_from_progress_marker(); | 53 get_updates->add_from_progress_marker(); |
| 55 dir->GetDownloadProgress(it.Get(), progress_marker); | 54 dir->GetDownloadProgress(it.Get(), progress_marker); |
| 56 | 55 |
| 57 // Set notification hint if present. | 56 // Set notification hint if present. |
| 58 syncer::ModelTypePayloadMap::const_iterator type_payload = | 57 ModelTypePayloadMap::const_iterator type_payload = |
| 59 type_payload_map.find(it.Get()); | 58 type_payload_map.find(it.Get()); |
| 60 if (type_payload != type_payload_map.end()) { | 59 if (type_payload != type_payload_map.end()) { |
| 61 progress_marker->set_notification_hint(type_payload->second); | 60 progress_marker->set_notification_hint(type_payload->second); |
| 62 } | 61 } |
| 63 } | 62 } |
| 64 | 63 |
| 65 // We want folders for our associated types, always. If we were to set | 64 // We want folders for our associated types, always. If we were to set |
| 66 // this to false, the server would send just the non-container items | 65 // this to false, the server would send just the non-container items |
| 67 // (e.g. Bookmark URLs but not their containing folders). | 66 // (e.g. Bookmark URLs but not their containing folders). |
| 68 get_updates->set_fetch_folders(true); | 67 get_updates->set_fetch_folders(true); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // could be null in some unit tests. | 115 // could be null in some unit tests. |
| 117 if (session->context()->debug_info_getter()) { | 116 if (session->context()->debug_info_getter()) { |
| 118 session->context()->debug_info_getter()->GetAndClearDebugInfo( | 117 session->context()->debug_info_getter()->GetAndClearDebugInfo( |
| 119 debug_info); | 118 debug_info); |
| 120 } | 119 } |
| 121 session->mutable_status_controller()->set_debug_info_sent(); | 120 session->mutable_status_controller()->set_debug_info_sent(); |
| 122 } | 121 } |
| 123 } | 122 } |
| 124 | 123 |
| 125 } // namespace syncer | 124 } // namespace syncer |
| OLD | NEW |