Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: chrome/browser/sync/engine/download_updates_command.cc

Issue 386030: Relieve SyncerSession,SyncCycleState, SyncProcessState, SyncerSession, Syncer... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome/browser/sync/engine/download_updates_command.h ('k') | chrome/browser/sync/engine/get_commit_ids_command.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698