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

Side by Side Diff: sync/engine/commit_processor.cc

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/engine/commit_processor.h" 5 #include "sync/engine/commit_processor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 19 matching lines...) Expand all
30 it.Good(); it.Inc()) { 30 it.Good(); it.Inc()) {
31 CommitContributorMap::iterator cm_it = 31 CommitContributorMap::iterator cm_it =
32 commit_contributor_map_->find(it.Get()); 32 commit_contributor_map_->find(it.Get());
33 if (cm_it == commit_contributor_map_->end()) { 33 if (cm_it == commit_contributor_map_->end()) {
34 NOTREACHED() 34 NOTREACHED()
35 << "Could not find requested type " << ModelTypeToString(it.Get()) 35 << "Could not find requested type " << ModelTypeToString(it.Get())
36 << " in contributor map."; 36 << " in contributor map.";
37 continue; 37 continue;
38 } 38 }
39 size_t spaces_remaining = max_entries - num_entries; 39 size_t spaces_remaining = max_entries - num_entries;
40 scoped_ptr<CommitContribution> contribution = 40 std::unique_ptr<CommitContribution> contribution =
41 cm_it->second->GetContribution(spaces_remaining); 41 cm_it->second->GetContribution(spaces_remaining);
42 if (contribution) { 42 if (contribution) {
43 num_entries += contribution->GetNumEntries(); 43 num_entries += contribution->GetNumEntries();
44 contributions->insert(std::make_pair(it.Get(), std::move(contribution))); 44 contributions->insert(std::make_pair(it.Get(), std::move(contribution)));
45 } 45 }
46 if (num_entries >= max_entries) { 46 if (num_entries >= max_entries) {
47 DCHECK_EQ(num_entries, max_entries) 47 DCHECK_EQ(num_entries, max_entries)
48 << "Number of commit entries exceeeds maximum"; 48 << "Number of commit entries exceeeds maximum";
49 break; 49 break;
50 } 50 }
51 } 51 }
52 } 52 }
53 53
54 } // namespace syncer 54 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698