Chromium Code Reviews| 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_ENTITY_TRACKER_H_ | 5 #ifndef SYNC_ENGINE_ENTITY_TRACKER_H_ |
| 6 #define SYNC_ENGINE_ENTITY_TRACKER_H_ | 6 #define SYNC_ENGINE_ENTITY_TRACKER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "sync/base/sync_export.h" | 13 #include "sync/base/sync_export.h" |
| 14 #include "sync/protocol/sync.pb.h" | 14 #include "sync/protocol/sync.pb.h" |
| 15 | 15 |
| 16 namespace syncer_v2 { | 16 namespace syncer_v2 { |
| 17 struct UpdateResponseData; | 17 struct UpdateResponseData; |
| 18 | 18 |
| 19 // Manages the pending commit and update state for an entity on the sync | 19 // Manages the pending commit and update state for an entity on the sync |
| 20 // thread. | 20 // thread. |
| 21 // | 21 // |
| 22 // It should be considered a helper class internal to the | 22 // It should be considered a helper class internal to the |
| 23 // ModelTypeSyncWorker. | 23 // CommitQueue. |
|
stanisc
2015/08/31 17:42:19
Internal to ModelTypeWorker
Gang Wu
2015/08/31 22:38:06
Done.
| |
| 24 // | 24 // |
| 25 // Maintains the state associated with a particular sync entity which is | 25 // Maintains the state associated with a particular sync entity which is |
| 26 // necessary for decision-making on the sync thread. It can track pending | 26 // necessary for decision-making on the sync thread. It can track pending |
| 27 // commit state, received update state, and can detect conflicts. | 27 // commit state, received update state, and can detect conflicts. |
| 28 // | 28 // |
| 29 // This object may or may not contain state associated with a pending commit. | 29 // This object may or may not contain state associated with a pending commit. |
| 30 // If no commit is pending, the |is_commit_pending_| flag will be set to false | 30 // If no commit is pending, the |is_commit_pending_| flag will be set to false |
| 31 // and many of this object's fields will be cleared. | 31 // and many of this object's fields will be cleared. |
| 32 class SYNC_EXPORT EntityTracker { | 32 class SYNC_EXPORT EntityTracker { |
| 33 public: | 33 public: |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 // an pending update prevents commits. As of this writing, the only source | 167 // an pending update prevents commits. As of this writing, the only source |
| 168 // of pending updates is updates we can't decrypt right now. | 168 // of pending updates is updates we can't decrypt right now. |
| 169 scoped_ptr<UpdateResponseData> pending_update_; | 169 scoped_ptr<UpdateResponseData> pending_update_; |
| 170 | 170 |
| 171 DISALLOW_COPY_AND_ASSIGN(EntityTracker); | 171 DISALLOW_COPY_AND_ASSIGN(EntityTracker); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 } // namespace syncer | 174 } // namespace syncer |
| 175 | 175 |
| 176 #endif // SYNC_ENGINE_ENTITY_TRACKER_H_ | 176 #endif // SYNC_ENGINE_ENTITY_TRACKER_H_ |
| OLD | NEW |