summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/engine/build_commit_command.cc
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-21 03:29:52 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-21 03:29:52 +0000
commit9ec27852a63c2d8fbcf4942629532af171f0a312 (patch)
tree5f22093d68d1699073439b40043383df8434da4f /chrome/browser/sync/engine/build_commit_command.cc
parentfb6be8f376c29a67ca134c71f3a4e3c414dd4c47 (diff)
downloadchromium_src-9ec27852a63c2d8fbcf4942629532af171f0a312.zip
chromium_src-9ec27852a63c2d8fbcf4942629532af171f0a312.tar.gz
chromium_src-9ec27852a63c2d8fbcf4942629532af171f0a312.tar.bz2
Add browser_sync 'sessions' to relieve SyncCycleState, SyncProcessState, SyncerSession,
SyncerStatus, and ConflictResolutionView of duty. Main impact is factors all status munging to 'StatusController', adds SyncSessionContext to wrap various engine parts needed by different components, removes duplicated methods by a factor of ~3 making it easier to reason about, and adds a 'Controller' to the session object to give a way to delegate session-global (i.e affecting any session) occurrences such as throttling. Also adds testing for 'HasMoreToSync' and other session related code. BUG=25266 TEST=SyncSessionTest(added), StatusControllerTest(added) various sync_unit_tests in this CL Review URL: http://codereview.chromium.org/386030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32732 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/engine/build_commit_command.cc')
-rw-r--r--chrome/browser/sync/engine/build_commit_command.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/sync/engine/build_commit_command.cc b/chrome/browser/sync/engine/build_commit_command.cc
index 637ab39..3e4e01a 100644
--- a/chrome/browser/sync/engine/build_commit_command.cc
+++ b/chrome/browser/sync/engine/build_commit_command.cc
@@ -9,9 +9,8 @@
#include <vector>
#include "chrome/browser/sync/engine/syncer_proto_util.h"
-#include "chrome/browser/sync/engine/syncer_session.h"
#include "chrome/browser/sync/engine/syncer_util.h"
-#include "chrome/browser/sync/engine/syncproto.h"
+#include "chrome/browser/sync/sessions/sync_session.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/syncable/syncable_changes_version.h"
#include "chrome/browser/sync/util/sync_types.h"
@@ -25,11 +24,13 @@ using syncable::MutableEntry;
namespace browser_sync {
+using sessions::SyncSession;
+
BuildCommitCommand::BuildCommitCommand() {}
BuildCommitCommand::~BuildCommitCommand() {}
void BuildCommitCommand::AddExtensionsActivityToMessage(
- SyncerSession* session, CommitMessage* message) {
+ SyncSession* session, CommitMessage* message) {
const ExtensionsActivityMonitor::Records& records =
session->extensions_activity();
for (ExtensionsActivityMonitor::Records::const_iterator it = records.begin();
@@ -42,9 +43,9 @@ void BuildCommitCommand::AddExtensionsActivityToMessage(
}
}
-void BuildCommitCommand::ExecuteImpl(SyncerSession* session) {
+void BuildCommitCommand::ExecuteImpl(SyncSession* session) {
ClientToServerMessage message;
- message.set_share(session->account_name());
+ message.set_share(session->context()->account_name());
message.set_message_contents(ClientToServerMessage::COMMIT);
CommitMessage* commit_message = message.mutable_commit();
@@ -52,7 +53,7 @@ void BuildCommitCommand::ExecuteImpl(SyncerSession* session) {
session->write_transaction()->directory()->cache_guid());
AddExtensionsActivityToMessage(session, commit_message);
- const vector<Id>& commit_ids = session->commit_ids();
+ const vector<Id>& commit_ids = session->status_controller()->commit_ids();
for (size_t i = 0; i < commit_ids.size(); i++) {
Id id = commit_ids[i];
SyncEntity* sync_entry =
@@ -147,7 +148,7 @@ void BuildCommitCommand::ExecuteImpl(SyncerSession* session) {
}
}
}
- session->set_commit_message(message);
+ session->status_controller()->mutable_commit_message()->CopyFrom(message);
}
} // namespace browser_sync