summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorvmpstr <vmpstr@chromium.org>2015-12-01 13:58:08 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-01 21:59:05 +0000
commit21ef98ca5d77f8d3aa297b05188b0135e40be361 (patch)
tree1b3e5247f3dfa43b6040ebb225728a7293c96e32 /sync
parentd59361bcb4e0a8ecd6985eb6865b53f8bbad0193 (diff)
downloadchromium_src-21ef98ca5d77f8d3aa297b05188b0135e40be361.zip
chromium_src-21ef98ca5d77f8d3aa297b05188b0135e40be361.tar.gz
chromium_src-21ef98ca5d77f8d3aa297b05188b0135e40be361.tar.bz2
sync/engine: switch base::ScopedPtrMap to std::map.
This patch switched ScopedPtrMap uses to std::map. It also adds DISALLOW_COPY_AND_ASSIGN to Commit which declares but doesn't define a copy ctor. If no copy ctor is specified, msvc would create it and fail to compile it. R=zea@chromium.org BUG=54291 Review URL: https://codereview.chromium.org/1488883003 Cr-Commit-Position: refs/heads/master@{#362515}
Diffstat (limited to 'sync')
-rw-r--r--sync/engine/commit.h9
-rw-r--r--sync/engine/commit_processor.cc4
2 files changed, 8 insertions, 5 deletions
diff --git a/sync/engine/commit.h b/sync/engine/commit.h
index d1ea552..871229f6 100644
--- a/sync/engine/commit.h
+++ b/sync/engine/commit.h
@@ -5,7 +5,9 @@
#ifndef SYNC_ENGINE_COMMIT_H_
#define SYNC_ENGINE_COMMIT_H_
-#include "base/containers/scoped_ptr_map.h"
+#include <map>
+
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "sync/base/sync_export.h"
#include "sync/engine/commit_contribution.h"
@@ -36,8 +38,7 @@ class Syncer;
// PostAndProcessCommitResponse() functions. So they ended up here.
class SYNC_EXPORT_PRIVATE Commit {
public:
- typedef base::ScopedPtrMap<ModelType, scoped_ptr<CommitContribution>>
- ContributionMap;
+ typedef std::map<ModelType, scoped_ptr<CommitContribution>> ContributionMap;
Commit(ContributionMap contributions,
const sync_pb::ClientToServerMessage& message,
@@ -73,6 +74,8 @@ class SYNC_EXPORT_PRIVATE Commit {
// Debug only flag used to indicate if it's safe to destruct the object.
bool cleaned_up_;
+
+ DISALLOW_COPY_AND_ASSIGN(Commit);
};
} // namespace syncer
diff --git a/sync/engine/commit_processor.cc b/sync/engine/commit_processor.cc
index a5149ac..4624fa4 100644
--- a/sync/engine/commit_processor.cc
+++ b/sync/engine/commit_processor.cc
@@ -4,7 +4,7 @@
#include "sync/engine/commit_processor.h"
-#include <map>
+#include <utility>
#include "sync/engine/commit_contribution.h"
#include "sync/engine/commit_contributor.h"
@@ -39,7 +39,7 @@ void CommitProcessor::GatherCommitContributions(
cm_it->second->GetContribution(spaces_remaining);
if (contribution) {
num_entries += contribution->GetNumEntries();
- contributions->insert(it.Get(), contribution.Pass());
+ contributions->insert(std::make_pair(it.Get(), std::move(contribution)));
}
if (num_entries >= max_entries) {
DCHECK_EQ(num_entries, max_entries)