| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_API_SYNC_CHANGE_H_ | 5 #ifndef SYNC_API_SYNC_CHANGE_H_ |
| 6 #define SYNC_API_SYNC_CHANGE_H_ | 6 #define SYNC_API_SYNC_CHANGE_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // the data. | 43 // the data. |
| 44 // Deletes: Requires valid tag when going to the syncer. Requires valid | 44 // Deletes: Requires valid tag when going to the syncer. Requires valid |
| 45 // specifics when coming from the syncer. | 45 // specifics when coming from the syncer. |
| 46 // Adds, Updates: Require valid tag and specifics when going to the syncer. | 46 // Adds, Updates: Require valid tag and specifics when going to the syncer. |
| 47 // Require only valid specifics when coming from the syncer. | 47 // Require only valid specifics when coming from the syncer. |
| 48 bool IsValid() const; | 48 bool IsValid() const; |
| 49 | 49 |
| 50 // Getters. | 50 // Getters. |
| 51 SyncChangeType change_type() const; | 51 SyncChangeType change_type() const; |
| 52 SyncData sync_data() const; | 52 SyncData sync_data() const; |
| 53 tracked_objects::Location location() const; |
| 53 | 54 |
| 54 // Returns a string representation of |change_type|. | 55 // Returns a string representation of |change_type|. |
| 55 static std::string ChangeTypeToString(SyncChangeType change_type); | 56 static std::string ChangeTypeToString(SyncChangeType change_type); |
| 56 | 57 |
| 57 // Returns a string representation of the entire object. Used for gmock | 58 // Returns a string representation of the entire object. Used for gmock |
| 58 // printing method, PrintTo. | 59 // printing method, PrintTo. |
| 59 std::string ToString() const; | 60 std::string ToString() const; |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 tracked_objects::Location location_; | 63 tracked_objects::Location location_; |
| 63 | 64 |
| 64 SyncChangeType change_type_; | 65 SyncChangeType change_type_; |
| 65 | 66 |
| 66 // An immutable container for the data of this SyncChange. Whenever | 67 // An immutable container for the data of this SyncChange. Whenever |
| 67 // SyncChanges are copied, they copy references to this data. | 68 // SyncChanges are copied, they copy references to this data. |
| 68 SyncData sync_data_; | 69 SyncData sync_data_; |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 // gmock printer helper. | 72 // gmock printer helper. |
| 72 void PrintTo(const SyncChange& sync_change, std::ostream* os); | 73 void PrintTo(const SyncChange& sync_change, std::ostream* os); |
| 73 | 74 |
| 74 } // namespace syncer | 75 } // namespace syncer |
| 75 | 76 |
| 76 #endif // SYNC_API_SYNC_CHANGE_H_ | 77 #endif // SYNC_API_SYNC_CHANGE_H_ |
| OLD | NEW |