| 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_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_ | 5 #ifndef SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_ |
| 6 #define SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_ | 6 #define SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class NonBlockingTypeCommitContribution : public CommitContribution { | 22 class NonBlockingTypeCommitContribution : public CommitContribution { |
| 23 public: | 23 public: |
| 24 NonBlockingTypeCommitContribution( | 24 NonBlockingTypeCommitContribution( |
| 25 const sync_pb::DataTypeContext& context, | 25 const sync_pb::DataTypeContext& context, |
| 26 const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, | 26 const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, |
| 27 const std::vector<int64>& sequence_numbers, | 27 const std::vector<int64>& sequence_numbers, |
| 28 ModelTypeSyncWorkerImpl* worker); | 28 ModelTypeSyncWorkerImpl* worker); |
| 29 virtual ~NonBlockingTypeCommitContribution(); | 29 virtual ~NonBlockingTypeCommitContribution(); |
| 30 | 30 |
| 31 // Implementation of CommitContribution | 31 // Implementation of CommitContribution |
| 32 virtual void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) OVERRIDE; | 32 virtual void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) override; |
| 33 virtual SyncerError ProcessCommitResponse( | 33 virtual SyncerError ProcessCommitResponse( |
| 34 const sync_pb::ClientToServerResponse& response, | 34 const sync_pb::ClientToServerResponse& response, |
| 35 sessions::StatusController* status) OVERRIDE; | 35 sessions::StatusController* status) override; |
| 36 virtual void CleanUp() OVERRIDE; | 36 virtual void CleanUp() override; |
| 37 virtual size_t GetNumEntries() const OVERRIDE; | 37 virtual size_t GetNumEntries() const override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 // A non-owned pointer back to the object that created this contribution. | 40 // A non-owned pointer back to the object that created this contribution. |
| 41 ModelTypeSyncWorkerImpl* const worker_; | 41 ModelTypeSyncWorkerImpl* const worker_; |
| 42 | 42 |
| 43 // The type-global context information. | 43 // The type-global context information. |
| 44 const sync_pb::DataTypeContext context_; | 44 const sync_pb::DataTypeContext context_; |
| 45 | 45 |
| 46 // The set of entities to be committed, serialized as SyncEntities. | 46 // The set of entities to be committed, serialized as SyncEntities. |
| 47 const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity> entities_; | 47 const google::protobuf::RepeatedPtrField<sync_pb::SyncEntity> entities_; |
| 48 | 48 |
| 49 // The sequence numbers associated with the pending commits. These match up | 49 // The sequence numbers associated with the pending commits. These match up |
| 50 // with the entities_ vector. | 50 // with the entities_ vector. |
| 51 const std::vector<int64> sequence_numbers_; | 51 const std::vector<int64> sequence_numbers_; |
| 52 | 52 |
| 53 // The index in the commit message where this contribution's entities are | 53 // The index in the commit message where this contribution's entities are |
| 54 // added. Used to correlate per-item requests with per-item responses. | 54 // added. Used to correlate per-item requests with per-item responses. |
| 55 size_t entries_start_index_; | 55 size_t entries_start_index_; |
| 56 | 56 |
| 57 // A flag used to ensure this object's contract is respected. Helps to check | 57 // A flag used to ensure this object's contract is respected. Helps to check |
| 58 // that CleanUp() is called before the object is destructed. | 58 // that CleanUp() is called before the object is destructed. |
| 59 bool cleaned_up_; | 59 bool cleaned_up_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(NonBlockingTypeCommitContribution); | 61 DISALLOW_COPY_AND_ASSIGN(NonBlockingTypeCommitContribution); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace syncer | 64 } // namespace syncer |
| 65 | 65 |
| 66 #endif // SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_ | 66 #endif // SYNC_ENGINE_NON_BLOCKING_TYPE_COMMIT_CONTRIBUTION_H_ |
| OLD | NEW |