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

Unified Diff: chrome/browser/sync/sessions/sync_session.cc

Issue 6270006: Revert 72685 - [SYNC] Refactor SyncSourceInfo and add support in chrome inval... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 months 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
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.h ('k') | chrome/browser/sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sessions/sync_session.cc
===================================================================
--- chrome/browser/sync/sessions/sync_session.cc (revision 72686)
+++ chrome/browser/sync/sessions/sync_session.cc (working copy)
@@ -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 old_source = source_;
source_ = SyncSourceInfo(
sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION,
- source_.types);
+ source_.second);
return old_source;
}
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.h ('k') | chrome/browser/sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698