Chromium Code Reviews| 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" |
| 11 #include "sync/engine/syncer_proto_util.h" | 11 #include "sync/engine/syncer_proto_util.h" |
| 12 #include "sync/engine/syncproto.h" | |
| 13 #include "sync/internal_api/public/base/model_type_payload_map.h" | 12 #include "sync/internal_api/public/base/model_type_payload_map.h" |
| 14 #include "sync/syncable/directory.h" | 13 #include "sync/syncable/directory.h" |
| 15 | 14 |
| 16 using sync_pb::DebugInfo; | 15 using sync_pb::DebugInfo; |
| 17 | 16 |
| 18 namespace syncer { | 17 namespace syncer { |
| 19 using sessions::StatusController; | 18 using sessions::StatusController; |
| 20 using sessions::SyncSession; | 19 using sessions::SyncSession; |
| 21 using std::string; | 20 using std::string; |
| 22 | 21 |
| 23 DownloadUpdatesCommand::DownloadUpdatesCommand( | 22 DownloadUpdatesCommand::DownloadUpdatesCommand( |
| 24 bool create_mobile_bookmarks_folder) | 23 bool create_mobile_bookmarks_folder) |
| 25 : create_mobile_bookmarks_folder_(create_mobile_bookmarks_folder) {} | 24 : create_mobile_bookmarks_folder_(create_mobile_bookmarks_folder) {} |
| 26 | 25 |
| 27 DownloadUpdatesCommand::~DownloadUpdatesCommand() {} | 26 DownloadUpdatesCommand::~DownloadUpdatesCommand() {} |
| 28 | 27 |
| 29 SyncerError DownloadUpdatesCommand::ExecuteImpl(SyncSession* session) { | 28 SyncerError DownloadUpdatesCommand::ExecuteImpl(SyncSession* session) { |
| 30 ClientToServerMessage client_to_server_message; | 29 sync_pb::ClientToServerMessage client_to_server_message; |
| 31 ClientToServerResponse update_response; | 30 sync_pb::ClientToServerResponse update_response; |
| 32 | 31 |
| 32 client_to_server_message.set_protocol_version( | |
|
akalin
2012/07/11 01:42:22
hmm multiple calls? Maybe put this call into Post
rlarocque
2012/07/11 19:22:16
Done. This has been converted to a function call
| |
| 33 client_to_server_message.protocol_version()); | |
| 33 client_to_server_message.set_share(session->context()->account_name()); | 34 client_to_server_message.set_share(session->context()->account_name()); |
| 34 client_to_server_message.set_message_contents( | 35 client_to_server_message.set_message_contents( |
| 35 ClientToServerMessage::GET_UPDATES); | 36 sync_pb::ClientToServerMessage::GET_UPDATES); |
| 36 GetUpdatesMessage* get_updates = | 37 sync_pb::GetUpdatesMessage* get_updates = |
| 37 client_to_server_message.mutable_get_updates(); | 38 client_to_server_message.mutable_get_updates(); |
| 38 get_updates->set_create_mobile_bookmarks_folder( | 39 get_updates->set_create_mobile_bookmarks_folder( |
| 39 create_mobile_bookmarks_folder_); | 40 create_mobile_bookmarks_folder_); |
| 40 | 41 |
| 41 syncable::Directory* dir = session->context()->directory(); | 42 syncable::Directory* dir = session->context()->directory(); |
| 42 | 43 |
| 43 // Request updates for all enabled types. | 44 // Request updates for all enabled types. |
| 44 const ModelTypeSet enabled_types = | 45 const ModelTypeSet enabled_types = |
| 45 GetRoutingInfoTypes(session->routing_info()); | 46 GetRoutingInfoTypes(session->routing_info()); |
| 46 DVLOG(1) << "Getting updates for types " | 47 DVLOG(1) << "Getting updates for types " |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 // could be null in some unit tests. | 117 // could be null in some unit tests. |
| 117 if (session->context()->debug_info_getter()) { | 118 if (session->context()->debug_info_getter()) { |
| 118 session->context()->debug_info_getter()->GetAndClearDebugInfo( | 119 session->context()->debug_info_getter()->GetAndClearDebugInfo( |
| 119 debug_info); | 120 debug_info); |
| 120 } | 121 } |
| 121 session->mutable_status_controller()->set_debug_info_sent(); | 122 session->mutable_status_controller()->set_debug_info_sent(); |
| 122 } | 123 } |
| 123 } | 124 } |
| 124 | 125 |
| 125 } // namespace syncer | 126 } // namespace syncer |
| OLD | NEW |