| Index: sync/engine/commit.cc
|
| diff --git a/sync/engine/commit.cc b/sync/engine/commit.cc
|
| index a8db1a41ee3821cad3572ad1b044b88075306410..665f709118d5144ae8c3ebaa0fd9030fdcac7b02 100644
|
| --- a/sync/engine/commit.cc
|
| +++ b/sync/engine/commit.cc
|
| @@ -30,34 +30,18 @@ Commit::~Commit() {
|
|
|
| Commit* Commit::Init(
|
| ModelTypeSet requested_types,
|
| + ModelTypeSet enabled_types,
|
| size_t max_entries,
|
| const std::string& account_name,
|
| const std::string& cache_guid,
|
| - CommitContributorMap* contributor_map,
|
| + CommitterList* committer_list,
|
| ExtensionsActivity* extensions_activity) {
|
| // Gather per-type contributions.
|
| ContributionMap contributions;
|
| - size_t num_entries = 0;
|
| - for (ModelTypeSet::Iterator it = requested_types.First();
|
| - it.Good(); it.Inc()) {
|
| - CommitContributorMap::iterator cm_it = contributor_map->find(it.Get());
|
| - if (cm_it == contributor_map->end()) {
|
| - NOTREACHED()
|
| - << "Could not find requested type " << ModelTypeToString(it.Get())
|
| - << " in contributor map.";
|
| - continue;
|
| - }
|
| - size_t spaces_remaining = max_entries - num_entries;
|
| - SyncDirectoryCommitContribution* contribution =
|
| - cm_it->second->GetContribution(spaces_remaining);
|
| - if (contribution) {
|
| - num_entries += contribution->GetNumEntries();
|
| - contributions.insert(std::make_pair(it.Get(), contribution));
|
| - }
|
| - if (num_entries == max_entries) {
|
| - break; // No point in continuting to iterate in this case.
|
| - }
|
| - }
|
| + committer_list->GatherCommitContributions(
|
| + requested_types,
|
| + max_entries,
|
| + &contributions);
|
|
|
| // Give up if no one had anything to commit.
|
| if (contributions.empty())
|
| @@ -81,13 +65,9 @@ Commit* Commit::Init(
|
| }
|
|
|
| // Set the client config params.
|
| - ModelTypeSet enabled_types;
|
| - for (CommitContributorMap::iterator it = contributor_map->begin();
|
| - it != contributor_map->end(); ++it) {
|
| - enabled_types.Put(it->first);
|
| - }
|
| - commit_util::AddClientConfigParamsToMessage(enabled_types,
|
| - commit_message);
|
| + commit_util::AddClientConfigParamsToMessage(
|
| + enabled_types,
|
| + commit_message);
|
|
|
| // Finally, serialize all our contributions.
|
| for (std::map<ModelType, SyncDirectoryCommitContribution*>::iterator it =
|
|
|