summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/engine/syncer_thread2.cc
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-03 17:23:27 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-03 17:23:27 +0000
commit3d2853d9119b49e0c549e075ecd0265e702e2e8d (patch)
treec060109ccc6123b919ddd96ee688e01674507e1a /chrome/browser/sync/engine/syncer_thread2.cc
parente7847ba2d39534090bdd8e82887ebef514f0a4b2 (diff)
downloadchromium_src-3d2853d9119b49e0c549e075ecd0265e702e2e8d.zip
chromium_src-3d2853d9119b49e0c549e075ecd0265e702e2e8d.tar.gz
chromium_src-3d2853d9119b49e0c549e075ecd0265e702e2e8d.tar.bz2
sync: add switch for using new syncer thread.
Also adds SyncerThreadAdapter (temp code) to facilitate swapping between implementations without tearing syncapi apart. BUG=26339 TEST=unit_tests, sync_unit_tests Review URL: http://codereview.chromium.org/6576049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76756 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/engine/syncer_thread2.cc')
-rw-r--r--chrome/browser/sync/engine/syncer_thread2.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/sync/engine/syncer_thread2.cc b/chrome/browser/sync/engine/syncer_thread2.cc
index 46ec2f8..ef46360 100644
--- a/chrome/browser/sync/engine/syncer_thread2.cc
+++ b/chrome/browser/sync/engine/syncer_thread2.cc
@@ -148,7 +148,6 @@ bool SyncerThread::ShouldRunJob(SyncSessionJobPurpose purpose,
return server_connection_ok_;
}
-namespace {
GetUpdatesCallerInfo::GetUpdatesSource GetUpdatesFromNudgeSource(
NudgeSource source) {
switch (source) {
@@ -167,14 +166,13 @@ GetUpdatesCallerInfo::GetUpdatesSource GetUpdatesFromNudgeSource(
}
// Functor for std::find_if to search by ModelSafeGroup.
-struct WorkerGroupIs {
- explicit WorkerGroupIs(ModelSafeGroup group) : group(group) {}
+struct ModelSafeWorkerGroupIs {
+ explicit ModelSafeWorkerGroupIs(ModelSafeGroup group) : group(group) {}
bool operator()(ModelSafeWorker* w) {
return group == w->GetModelSafeGroup();
}
ModelSafeGroup group;
};
-} // namespace
void SyncerThread::ScheduleClearUserData() {
if (!thread_.IsRunning()) {
@@ -272,7 +270,8 @@ void GetModelSafeParamsForTypes(const ModelTypeBitSet& types,
syncable::ModelType t = syncable::ModelTypeFromInt(i);
DCHECK_EQ(1U, r_tmp.count(t));
(*routes)[t] = r_tmp[t];
- iter it = std::find_if(w_tmp.begin(), w_tmp.end(), WorkerGroupIs(r_tmp[t]));
+ iter it = std::find_if(w_tmp.begin(), w_tmp.end(),
+ ModelSafeWorkerGroupIs(r_tmp[t]));
if (it != w_tmp.end())
workers->push_back(*it);
else
@@ -280,7 +279,7 @@ void GetModelSafeParamsForTypes(const ModelTypeBitSet& types,
}
iter it = std::find_if(w_tmp.begin(), w_tmp.end(),
- WorkerGroupIs(GROUP_PASSIVE));
+ ModelSafeWorkerGroupIs(GROUP_PASSIVE));
if (it != w_tmp.end())
workers->push_back(*it);
else