OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/download_updates_command.h" | 5 #include "chrome/browser/sync/engine/download_updates_command.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/browser/sync/engine/syncer.h" | 9 #include "chrome/browser/sync/engine/syncer.h" |
10 #include "chrome/browser/sync/engine/syncer_proto_util.h" | 10 #include "chrome/browser/sync/engine/syncer_proto_util.h" |
11 #include "chrome/browser/sync/engine/syncproto.h" | 11 #include "chrome/browser/sync/engine/syncproto.h" |
12 #include "chrome/browser/sync/syncable/directory_manager.h" | 12 #include "chrome/browser/sync/syncable/directory_manager.h" |
13 #include "chrome/browser/sync/util/character_set_converters.h" | |
14 #include "chrome/browser/sync/util/sync_types.h" | 13 #include "chrome/browser/sync/util/sync_types.h" |
15 | 14 |
16 using syncable::ScopedDirLookup; | 15 using syncable::ScopedDirLookup; |
17 | 16 |
18 namespace browser_sync { | 17 namespace browser_sync { |
19 | 18 |
20 using std::string; | 19 using std::string; |
21 | 20 |
22 DownloadUpdatesCommand::DownloadUpdatesCommand() {} | 21 DownloadUpdatesCommand::DownloadUpdatesCommand() {} |
23 DownloadUpdatesCommand::~DownloadUpdatesCommand() {} | 22 DownloadUpdatesCommand::~DownloadUpdatesCommand() {} |
24 | 23 |
25 void DownloadUpdatesCommand::ExecuteImpl(SyncerSession* session) { | 24 void DownloadUpdatesCommand::ExecuteImpl(SyncerSession* session) { |
26 ClientToServerMessage client_to_server_message; | 25 ClientToServerMessage client_to_server_message; |
27 ClientToServerResponse update_response; | 26 ClientToServerResponse update_response; |
28 | 27 |
29 client_to_server_message.set_share( | 28 client_to_server_message.set_share(session->account_name()); |
30 static_cast<const string&>(ToUTF8(session->account_name()))); | |
31 client_to_server_message.set_message_contents( | 29 client_to_server_message.set_message_contents( |
32 ClientToServerMessage::GET_UPDATES); | 30 ClientToServerMessage::GET_UPDATES); |
33 GetUpdatesMessage* get_updates = | 31 GetUpdatesMessage* get_updates = |
34 client_to_server_message.mutable_get_updates(); | 32 client_to_server_message.mutable_get_updates(); |
35 | 33 |
36 ScopedDirLookup dir(session->dirman(), session->account_name()); | 34 ScopedDirLookup dir(session->dirman(), session->account_name()); |
37 if (!dir.good()) { | 35 if (!dir.good()) { |
38 LOG(ERROR) << "Scoped dir lookup failed!"; | 36 LOG(ERROR) << "Scoped dir lookup failed!"; |
39 return; | 37 return; |
40 } | 38 } |
(...skipping 14 matching lines...) Expand all Loading... |
55 SyncerStatus status(session); | 53 SyncerStatus status(session); |
56 status.increment_consecutive_problem_get_updates(); | 54 status.increment_consecutive_problem_get_updates(); |
57 status.increment_consecutive_errors(); | 55 status.increment_consecutive_errors(); |
58 LOG(ERROR) << "PostClientToServerMessage() failed"; | 56 LOG(ERROR) << "PostClientToServerMessage() failed"; |
59 return; | 57 return; |
60 } | 58 } |
61 session->set_update_response(update_response); | 59 session->set_update_response(update_response); |
62 } | 60 } |
63 | 61 |
64 } // namespace browser_sync | 62 } // namespace browser_sync |
OLD | NEW |