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

Unified Diff: sync/sessions/sync_session.cc

Issue 10690071: [Sync] Move model_type* from syncable/ to base/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « sync/sessions/sync_session.h ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/sync_session.cc
diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc
index da73b1a4f9f09b358490948b550ce190102ea778..19a643d3b8f3221ee2c285aaa0083f610886d75d 100644
--- a/sync/sessions/sync_session.cc
+++ b/sync/sessions/sync_session.cc
@@ -8,7 +8,8 @@
#include <iterator>
#include "base/logging.h"
-#include "sync/internal_api/public/syncable/model_type.h"
+#include "sync/internal_api/public/base/model_type.h"
+#include "sync/internal_api/public/engine/model_safe_worker.h"
#include "sync/syncable/directory.h"
namespace syncer {
@@ -47,6 +48,23 @@ std::set<ModelSafeGroup> ComputeEnabledGroups(
return enabled_groups;
}
+void PurgeStalePayload(syncable::ModelTypePayloadMap* original,
+ const ModelSafeRoutingInfo& routing_info) {
+ std::vector<syncable::ModelTypePayloadMap::iterator> iterators_to_delete;
+ for (syncable::ModelTypePayloadMap::iterator i = original->begin();
+ i != original->end(); ++i) {
+ if (routing_info.end() == routing_info.find(i->first)) {
+ iterators_to_delete.push_back(i);
+ }
+ }
+
+ for (std::vector<syncable::ModelTypePayloadMap::iterator>::iterator
+ it = iterators_to_delete.begin(); it != iterators_to_delete.end();
+ ++it) {
+ original->erase(*it);
+ }
+}
+
} // namesepace
SyncSession::SyncSession(SyncSessionContext* context, Delegate* delegate,
« no previous file with comments | « sync/sessions/sync_session.h ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698