OLD | NEW |
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_CONTRIBUTION_H_ | 5 #ifndef SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTION_H_ |
6 #define SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTION_H_ | 6 #define SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 syncable::Directory* dir, | 49 syncable::Directory* dir, |
50 ModelType type, | 50 ModelType type, |
51 size_t max_items, | 51 size_t max_items, |
52 DirectoryTypeDebugInfoEmitter* debug_info_emitter); | 52 DirectoryTypeDebugInfoEmitter* debug_info_emitter); |
53 | 53 |
54 // Serialize this contribution's entries to the given commit request |msg|. | 54 // Serialize this contribution's entries to the given commit request |msg|. |
55 // | 55 // |
56 // This function is not const. It will update some state in this contribution | 56 // This function is not const. It will update some state in this contribution |
57 // that will be used when processing the associated commit response. This | 57 // that will be used when processing the associated commit response. This |
58 // function should not be called more than once. | 58 // function should not be called more than once. |
59 virtual void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) OVERRIDE; | 59 virtual void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) override; |
60 | 60 |
61 // Updates this contribution's contents in accordance with the provided | 61 // Updates this contribution's contents in accordance with the provided |
62 // |response|. | 62 // |response|. |
63 // | 63 // |
64 // This function may make model-neutral changes to the directory. It is not | 64 // This function may make model-neutral changes to the directory. It is not |
65 // valid to call this function unless AddToCommitMessage() was called earlier. | 65 // valid to call this function unless AddToCommitMessage() was called earlier. |
66 // This function should not be called more than once. | 66 // This function should not be called more than once. |
67 virtual SyncerError ProcessCommitResponse( | 67 virtual SyncerError ProcessCommitResponse( |
68 const sync_pb::ClientToServerResponse& response, | 68 const sync_pb::ClientToServerResponse& response, |
69 sessions::StatusController* status) OVERRIDE; | 69 sessions::StatusController* status) override; |
70 | 70 |
71 // Cleans up any temporary state associated with the commit. Must be called | 71 // Cleans up any temporary state associated with the commit. Must be called |
72 // before destruction. | 72 // before destruction. |
73 virtual void CleanUp() OVERRIDE; | 73 virtual void CleanUp() override; |
74 | 74 |
75 // Returns the number of entries included in this contribution. | 75 // Returns the number of entries included in this contribution. |
76 virtual size_t GetNumEntries() const OVERRIDE; | 76 virtual size_t GetNumEntries() const override; |
77 | 77 |
78 private: | 78 private: |
79 class DirectoryCommitContributionTest; | 79 class DirectoryCommitContributionTest; |
80 FRIEND_TEST_ALL_PREFIXES(DirectoryCommitContributionTest, GatherByTypes); | 80 FRIEND_TEST_ALL_PREFIXES(DirectoryCommitContributionTest, GatherByTypes); |
81 FRIEND_TEST_ALL_PREFIXES(DirectoryCommitContributionTest, | 81 FRIEND_TEST_ALL_PREFIXES(DirectoryCommitContributionTest, |
82 GatherAndTruncate); | 82 GatherAndTruncate); |
83 | 83 |
84 DirectoryCommitContribution( | 84 DirectoryCommitContribution( |
85 const std::vector<int64>& metahandles, | 85 const std::vector<int64>& metahandles, |
86 const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, | 86 const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, |
(...skipping 17 matching lines...) Expand all Loading... |
104 | 104 |
105 // A pointer to the commit counters of our parent CommitContributor. | 105 // A pointer to the commit counters of our parent CommitContributor. |
106 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; | 106 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; |
107 | 107 |
108 DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContribution); | 108 DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContribution); |
109 }; | 109 }; |
110 | 110 |
111 } // namespace syncer | 111 } // namespace syncer |
112 | 112 |
113 #endif // SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTION_H_ | 113 #endif // SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTION_H_ |
OLD | NEW |