| 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,
|
|
|