| Index: chrome/browser/sync/engine/download_updates_command.cc
|
| ===================================================================
|
| --- chrome/browser/sync/engine/download_updates_command.cc (revision 32731)
|
| +++ chrome/browser/sync/engine/download_updates_command.cc (working copy)
|
| @@ -9,29 +9,32 @@
|
| #include "chrome/browser/sync/engine/syncer.h"
|
| #include "chrome/browser/sync/engine/syncer_proto_util.h"
|
| #include "chrome/browser/sync/engine/syncproto.h"
|
| +#include "chrome/browser/sync/sessions/sync_session.h"
|
| #include "chrome/browser/sync/syncable/directory_manager.h"
|
| #include "chrome/browser/sync/util/sync_types.h"
|
|
|
| using syncable::ScopedDirLookup;
|
|
|
| namespace browser_sync {
|
| -
|
| +using sessions::StatusController;
|
| +using sessions::SyncSession;
|
| using std::string;
|
|
|
| DownloadUpdatesCommand::DownloadUpdatesCommand() {}
|
| DownloadUpdatesCommand::~DownloadUpdatesCommand() {}
|
|
|
| -void DownloadUpdatesCommand::ExecuteImpl(SyncerSession* session) {
|
| +void DownloadUpdatesCommand::ExecuteImpl(SyncSession* session) {
|
| ClientToServerMessage client_to_server_message;
|
| ClientToServerResponse update_response;
|
|
|
| - client_to_server_message.set_share(session->account_name());
|
| + client_to_server_message.set_share(session->context()->account_name());
|
| client_to_server_message.set_message_contents(
|
| ClientToServerMessage::GET_UPDATES);
|
| GetUpdatesMessage* get_updates =
|
| client_to_server_message.mutable_get_updates();
|
|
|
| - ScopedDirLookup dir(session->dirman(), session->account_name());
|
| + ScopedDirLookup dir(session->context()->directory_manager(),
|
| + session->context()->account_name());
|
| if (!dir.good()) {
|
| LOG(ERROR) << "Scoped dir lookup failed!";
|
| return;
|
| @@ -42,21 +45,21 @@
|
| // Set GetUpdatesMessage.GetUpdatesCallerInfo information.
|
| get_updates->mutable_caller_info()->set_source(session->TestAndSetSource());
|
| get_updates->mutable_caller_info()->set_notifications_enabled(
|
| - session->notifications_enabled());
|
| + session->context()->notifications_enabled());
|
|
|
| bool ok = SyncerProtoUtil::PostClientToServerMessage(
|
| &client_to_server_message,
|
| &update_response,
|
| session);
|
|
|
| + StatusController* status = session->status_controller();
|
| if (!ok) {
|
| - SyncerStatus status(session);
|
| - status.increment_consecutive_problem_get_updates();
|
| - status.increment_consecutive_errors();
|
| + status->increment_num_consecutive_problem_get_updates();
|
| + status->increment_num_consecutive_errors();
|
| LOG(ERROR) << "PostClientToServerMessage() failed";
|
| return;
|
| }
|
| - session->set_update_response(update_response);
|
| + status->mutable_updates_response()->CopyFrom(update_response);
|
| }
|
|
|
| } // namespace browser_sync
|
|
|