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

Side by Side Diff: sync/engine/directory_commit_contributor.h

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 #ifndef SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_ 5 #ifndef SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_
6 #define SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_ 6 #define SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory>
11 12
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "sync/engine/commit_contributor.h" 14 #include "sync/engine/commit_contributor.h"
15 #include "sync/engine/directory_commit_contribution.h" 15 #include "sync/engine/directory_commit_contribution.h"
16 #include "sync/internal_api/public/base/model_type.h" 16 #include "sync/internal_api/public/base/model_type.h"
17 17
18 namespace syncer { 18 namespace syncer {
19 19
20 namespace syncable { 20 namespace syncable {
21 class Directory; 21 class Directory;
22 } 22 }
23 23
24 class DirectoryTypeDebugInfoEmitter; 24 class DirectoryTypeDebugInfoEmitter;
25 25
26 // This class represents the syncable::Directory as a source of items to commit 26 // This class represents the syncable::Directory as a source of items to commit
27 // to the sync server. 27 // to the sync server.
28 // 28 //
29 // Each instance of this class represents a particular type within the 29 // Each instance of this class represents a particular type within the
30 // syncable::Directory. When asked, it will iterate through the directory, grab 30 // syncable::Directory. When asked, it will iterate through the directory, grab
31 // any items of its type that are ready for commit, and return them in the form 31 // any items of its type that are ready for commit, and return them in the form
32 // of a DirectoryCommitContribution. 32 // of a DirectoryCommitContribution.
33 class DirectoryCommitContributor : public CommitContributor { 33 class DirectoryCommitContributor : public CommitContributor {
34 public: 34 public:
35 DirectoryCommitContributor(syncable::Directory* dir, 35 DirectoryCommitContributor(syncable::Directory* dir,
36 ModelType type, 36 ModelType type,
37 DirectoryTypeDebugInfoEmitter* debug_info_emitter); 37 DirectoryTypeDebugInfoEmitter* debug_info_emitter);
38 ~DirectoryCommitContributor() override; 38 ~DirectoryCommitContributor() override;
39 39
40 scoped_ptr<CommitContribution> GetContribution(size_t max_entries) override; 40 std::unique_ptr<CommitContribution> GetContribution(
41 size_t max_entries) override;
41 42
42 private: 43 private:
43 syncable::Directory* dir_; 44 syncable::Directory* dir_;
44 ModelType type_; 45 ModelType type_;
45 46
46 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; 47 DirectoryTypeDebugInfoEmitter* debug_info_emitter_;
47 48
48 DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContributor); 49 DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContributor);
49 }; 50 };
50 51
51 } // namespace syncer 52 } // namespace syncer
52 53
53 #endif // SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_ 54 #endif // SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698