OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.h" | 5 #include "sync/engine/download.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/process_updates_util.h" | 10 #include "sync/engine/process_updates_util.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 get_updates); | 324 get_updates); |
325 | 325 |
326 // Set legacy GetUpdatesMessage.GetUpdatesCallerInfo information. | 326 // Set legacy GetUpdatesMessage.GetUpdatesCallerInfo information. |
327 get_updates->mutable_caller_info()->set_source( | 327 get_updates->mutable_caller_info()->set_source( |
328 sync_pb::GetUpdatesCallerInfo::PERIODIC); | 328 sync_pb::GetUpdatesCallerInfo::PERIODIC); |
329 | 329 |
330 // Set the new and improved version of source, too. | 330 // Set the new and improved version of source, too. |
331 get_updates->set_get_updates_origin(sync_pb::SyncEnums::PERIODIC); | 331 get_updates->set_get_updates_origin(sync_pb::SyncEnums::PERIODIC); |
332 } | 332 } |
333 | 333 |
| 334 void BuildDownloadUpdatesForRetry( |
| 335 SyncSession* session, |
| 336 bool create_mobile_bookmarks_folder, |
| 337 ModelTypeSet request_types, |
| 338 sync_pb::ClientToServerMessage* client_to_server_message) { |
| 339 DVLOG(1) << "Retrying for types " |
| 340 << ModelTypeSetToString(request_types); |
| 341 |
| 342 InitDownloadUpdatesContext( |
| 343 session, |
| 344 create_mobile_bookmarks_folder, |
| 345 client_to_server_message); |
| 346 BuildDownloadUpdatesForRetryImpl( |
| 347 Intersection(request_types, ProtocolTypes()), |
| 348 session->context()->update_handler_map(), |
| 349 client_to_server_message->mutable_get_updates()); |
| 350 } |
| 351 |
| 352 void BuildDownloadUpdatesForRetryImpl( |
| 353 ModelTypeSet proto_request_types, |
| 354 UpdateHandlerMap* update_handler_map, |
| 355 sync_pb::GetUpdatesMessage* get_updates) { |
| 356 DCHECK(!proto_request_types.Empty()); |
| 357 |
| 358 InitDownloadUpdatesProgress( |
| 359 proto_request_types, |
| 360 update_handler_map, |
| 361 get_updates); |
| 362 |
| 363 // Set legacy GetUpdatesMessage.GetUpdatesCallerInfo information. |
| 364 get_updates->mutable_caller_info()->set_source( |
| 365 sync_pb::GetUpdatesCallerInfo::RETRY); |
| 366 |
| 367 // Set the new and improved version of source, too. |
| 368 get_updates->set_get_updates_origin(sync_pb::SyncEnums::RETRY); |
| 369 } |
| 370 |
334 SyncerError ExecuteDownloadUpdates( | 371 SyncerError ExecuteDownloadUpdates( |
335 ModelTypeSet request_types, | 372 ModelTypeSet request_types, |
336 SyncSession* session, | 373 SyncSession* session, |
337 sync_pb::ClientToServerMessage* msg) { | 374 sync_pb::ClientToServerMessage* msg) { |
338 sync_pb::ClientToServerResponse update_response; | 375 sync_pb::ClientToServerResponse update_response; |
339 StatusController* status = session->mutable_status_controller(); | 376 StatusController* status = session->mutable_status_controller(); |
340 bool need_encryption_key = ShouldRequestEncryptionKey(session->context()); | 377 bool need_encryption_key = ShouldRequestEncryptionKey(session->context()); |
341 | 378 |
342 if (session->context()->debug_info_getter()) { | 379 if (session->context()->debug_info_getter()) { |
343 sync_pb::DebugInfo* debug_info = msg->mutable_debug_info(); | 380 sync_pb::DebugInfo* debug_info = msg->mutable_debug_info(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 void CopyClientDebugInfo( | 454 void CopyClientDebugInfo( |
418 sessions::DebugInfoGetter* debug_info_getter, | 455 sessions::DebugInfoGetter* debug_info_getter, |
419 sync_pb::DebugInfo* debug_info) { | 456 sync_pb::DebugInfo* debug_info) { |
420 DVLOG(1) << "Copying client debug info to send."; | 457 DVLOG(1) << "Copying client debug info to send."; |
421 debug_info_getter->GetDebugInfo(debug_info); | 458 debug_info_getter->GetDebugInfo(debug_info); |
422 } | 459 } |
423 | 460 |
424 } // namespace download | 461 } // namespace download |
425 | 462 |
426 } // namespace syncer | 463 } // namespace syncer |
OLD | NEW |