| 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" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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: |
| 34 ~EntityTracker(); | 34 ~EntityTracker(); |
| 35 | 35 |
| 36 // Initialize a new entity based on an update response. | 36 // Initialize a new entity based on an update response. |
| 37 static EntityTracker* FromServerUpdate(const std::string& id_string, | 37 static scoped_ptr<EntityTracker> FromServerUpdate( |
| 38 const std::string& client_tag_hash, | 38 const std::string& id_string, |
| 39 int64 version); | 39 const std::string& client_tag_hash, |
| 40 int64 version); |
| 40 | 41 |
| 41 // Initialize a new entity based on a commit request. | 42 // Initialize a new entity based on a commit request. |
| 42 static EntityTracker* FromCommitRequest( | 43 static scoped_ptr<EntityTracker> FromCommitRequest( |
| 43 const std::string& id_string, | 44 const std::string& id_string, |
| 44 const std::string& client_tag_hash, | 45 const std::string& client_tag_hash, |
| 45 int64 sequence_number, | 46 int64 sequence_number, |
| 46 int64 base_version, | 47 int64 base_version, |
| 47 base::Time ctime, | 48 base::Time ctime, |
| 48 base::Time mtime, | 49 base::Time mtime, |
| 49 const std::string& non_unique_name, | 50 const std::string& non_unique_name, |
| 50 bool deleted, | 51 bool deleted, |
| 51 const sync_pb::EntitySpecifics& specifics); | 52 const sync_pb::EntitySpecifics& specifics); |
| 52 | 53 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // 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 |
| 167 // of pending updates is updates we can't decrypt right now. | 168 // of pending updates is updates we can't decrypt right now. |
| 168 scoped_ptr<UpdateResponseData> pending_update_; | 169 scoped_ptr<UpdateResponseData> pending_update_; |
| 169 | 170 |
| 170 DISALLOW_COPY_AND_ASSIGN(EntityTracker); | 171 DISALLOW_COPY_AND_ASSIGN(EntityTracker); |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 } // namespace syncer | 174 } // namespace syncer |
| 174 | 175 |
| 175 #endif // SYNC_ENGINE_ENTITY_TRACKER_H_ | 176 #endif // SYNC_ENGINE_ENTITY_TRACKER_H_ |
| OLD | NEW |