summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sessions/sync_session.cc
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 20:46:36 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 20:46:36 +0000
commit4a6d85644a21afb4d2bc10edf7808a23811b9004 (patch)
tree13b32e91ed3bc5cfe78f9349673707abc98ceb46 /chrome/browser/sync/sessions/sync_session.cc
parent590426ed28c056eb64e51bdea866d1934188c3fb (diff)
downloadchromium_src-4a6d85644a21afb4d2bc10edf7808a23811b9004.zip
chromium_src-4a6d85644a21afb4d2bc10edf7808a23811b9004.tar.gz
chromium_src-4a6d85644a21afb4d2bc10edf7808a23811b9004.tar.bz2
Revert 72685 - [SYNC] Refactor SyncSourceInfo and add support in chrome invalidation client and syncer thread for passing a datatype-specific payload originating in the invalidation server and directed at the sync frontend server. Also fixes bug with last_sync_time and PostTimeToTypeHistogram, which would get hit when the unit tests were being run.
BUG=68572,69558 TEST=unit Review URL: http://codereview.chromium.org/6182004 TBR=zea@chromium.org Review URL: http://codereview.chromium.org/6270006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sessions/sync_session.cc')
-rw-r--r--chrome/browser/sync/sessions/sync_session.cc49
1 files changed, 1 insertions, 48 deletions
diff --git a/chrome/browser/sync/sessions/sync_session.cc b/chrome/browser/sync/sessions/sync_session.cc
index c5876f9..077b629 100644
--- a/chrome/browser/sync/sessions/sync_session.cc
+++ b/chrome/browser/sync/sessions/sync_session.cc
@@ -9,53 +9,6 @@
namespace browser_sync {
namespace sessions {
-TypePayloadMap ModelTypeBitSetToTypePayloadMap(
- const syncable::ModelTypeBitSet& types,
- const std::string& payload) {
- TypePayloadMap types_with_payloads;
- for (size_t i = syncable::FIRST_REAL_MODEL_TYPE;
- i < types.size(); ++i) {
- if (types[i]) {
- types_with_payloads[syncable::ModelTypeFromInt(i)] = payload;
- }
- }
- return types_with_payloads;
-}
-
-TypePayloadMap RoutingInfoToTypePayloadMap(const ModelSafeRoutingInfo& routes,
- const std::string& payload) {
- TypePayloadMap types_with_payloads;
- for (ModelSafeRoutingInfo::const_iterator i = routes.begin();
- i != routes.end(); ++i) {
- types_with_payloads[i->first] = payload;
- }
- return types_with_payloads;
-}
-
-void CoalescePayloads(TypePayloadMap* original,
- const TypePayloadMap& update) {
- for (TypePayloadMap::const_iterator i = update.begin();
- i != update.end(); ++i) {
- if (original->count(i->first) == 0) {
- // If this datatype isn't already in our map, add it with whatever payload
- // it has.
- (*original)[i->first] = i->second;
- } else if (i->second.length() > 0) {
- // If this datatype is already in our map, we only overwrite the payload
- // if the new one is non-empty.
- (*original)[i->first] = i->second;
- }
- }
-}
-
-SyncSourceInfo::SyncSourceInfo()
- : updates_source(sync_pb::GetUpdatesCallerInfo::UNKNOWN) {}
-
-SyncSourceInfo::SyncSourceInfo(
- const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& u,
- const TypePayloadMap& t)
- : updates_source(u), types(t) {}
-
SyncSession::SyncSession(SyncSessionContext* context, Delegate* delegate,
SyncSourceInfo source,
const ModelSafeRoutingInfo& routing_info,
@@ -136,7 +89,7 @@ SyncSourceInfo SyncSession::TestAndSetSource() {
SyncSourceInfo old_source = source_;
source_ = SyncSourceInfo(
sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION,
- source_.types);
+ source_.second);
return old_source;
}