| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 status->mutable_updates_response()->CopyFrom(update_response); | 135 status->mutable_updates_response()->CopyFrom(update_response); |
| 136 | 136 |
| 137 DVLOG(1) << "GetUpdates " | 137 DVLOG(1) << "GetUpdates " |
| 138 << " returned " << update_response.get_updates().entries_size() | 138 << " returned " << update_response.get_updates().entries_size() |
| 139 << " updates and indicated " | 139 << " updates and indicated " |
| 140 << update_response.get_updates().changes_remaining() | 140 << update_response.get_updates().changes_remaining() |
| 141 << " updates left on server."; | 141 << " updates left on server."; |
| 142 | 142 |
| 143 if (update_response.has_client_command()) { |
| 144 session->ProcessClientCommand(update_response.client_command()); |
| 145 } |
| 146 |
| 143 if (need_encryption_key) { | 147 if (need_encryption_key) { |
| 144 status->set_last_get_key_result( | 148 status->set_last_get_key_result( |
| 145 HandleGetEncryptionKeyResponse(update_response, dir)); | 149 HandleGetEncryptionKeyResponse(update_response, dir)); |
| 146 } | 150 } |
| 147 | 151 |
| 148 return result; | 152 return result; |
| 149 } | 153 } |
| 150 | 154 |
| 151 void DownloadUpdatesCommand::AppendClientDebugInfoIfNeeded( | 155 void DownloadUpdatesCommand::AppendClientDebugInfoIfNeeded( |
| 152 sessions::SyncSession* session, | 156 sessions::SyncSession* session, |
| 153 DebugInfo* debug_info) { | 157 DebugInfo* debug_info) { |
| 154 // We want to send the debug info only once per sync cycle. Check if it has | 158 // We want to send the debug info only once per sync cycle. Check if it has |
| 155 // already been sent. | 159 // already been sent. |
| 156 if (!session->status_controller().debug_info_sent()) { | 160 if (!session->status_controller().debug_info_sent()) { |
| 157 DVLOG(1) << "Sending client debug info ..."; | 161 DVLOG(1) << "Sending client debug info ..."; |
| 158 // could be null in some unit tests. | 162 // could be null in some unit tests. |
| 159 if (session->context()->debug_info_getter()) { | 163 if (session->context()->debug_info_getter()) { |
| 160 session->context()->debug_info_getter()->GetAndClearDebugInfo( | 164 session->context()->debug_info_getter()->GetAndClearDebugInfo( |
| 161 debug_info); | 165 debug_info); |
| 162 } | 166 } |
| 163 session->mutable_status_controller()->set_debug_info_sent(); | 167 session->mutable_status_controller()->set_debug_info_sent(); |
| 164 } | 168 } |
| 165 } | 169 } |
| 166 | 170 |
| 167 } // namespace syncer | 171 } // namespace syncer |
| OLD | NEW |