| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_INTERNAL_API_PUBLIC_CHANGE_RECORD_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_CHANGE_RECORD_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_CHANGE_RECORD_H_ | 6 #define COMPONENTS_SYNC_CORE_CHANGE_RECORD_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "sync/base/sync_export.h" | 14 #include "components/sync/base/immutable.h" |
| 15 #include "sync/internal_api/public/util/immutable.h" | 15 #include "components/sync/base/sync_export.h" |
| 16 #include "sync/protocol/password_specifics.pb.h" | 16 #include "components/sync/protocol/password_specifics.pb.h" |
| 17 #include "sync/protocol/sync.pb.h" | 17 #include "components/sync/protocol/sync.pb.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class DictionaryValue; | 20 class DictionaryValue; |
| 21 } // namespace base | 21 } // namespace base |
| 22 | 22 |
| 23 namespace syncer { | 23 namespace syncer { |
| 24 | 24 |
| 25 // TODO(zea): One day get passwords playing nicely with the rest of encryption | 25 // TODO(zea): One day get passwords playing nicely with the rest of encryption |
| 26 // and get rid of this. | 26 // and get rid of this. |
| 27 class SYNC_EXPORT ExtraPasswordChangeRecordData { | 27 class SYNC_EXPORT ExtraPasswordChangeRecordData { |
| 28 public: | 28 public: |
| 29 ExtraPasswordChangeRecordData(); | 29 ExtraPasswordChangeRecordData(); |
| 30 explicit ExtraPasswordChangeRecordData( | 30 explicit ExtraPasswordChangeRecordData( |
| 31 const sync_pb::PasswordSpecificsData& data); | 31 const sync_pb::PasswordSpecificsData& data); |
| 32 virtual ~ExtraPasswordChangeRecordData(); | 32 virtual ~ExtraPasswordChangeRecordData(); |
| 33 | 33 |
| 34 virtual std::unique_ptr<base::DictionaryValue> ToValue() const; | 34 virtual std::unique_ptr<base::DictionaryValue> ToValue() const; |
| 35 | 35 |
| 36 const sync_pb::PasswordSpecificsData& unencrypted() const; | 36 const sync_pb::PasswordSpecificsData& unencrypted() const; |
| 37 |
| 37 private: | 38 private: |
| 38 sync_pb::PasswordSpecificsData unencrypted_; | 39 sync_pb::PasswordSpecificsData unencrypted_; |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 // ChangeRecord indicates a single item that changed as a result of a sync | 42 // ChangeRecord indicates a single item that changed as a result of a sync |
| 42 // operation. This gives the sync id of the node that changed, and the type | 43 // operation. This gives the sync id of the node that changed, and the type |
| 43 // of change. To get the actual property values after an ADD or UPDATE, the | 44 // of change. To get the actual property values after an ADD or UPDATE, the |
| 44 // client should get the node with InitByIdLookup(), using the provided id. | 45 // client should get the node with InitByIdLookup(), using the provided id. |
| 45 struct SYNC_EXPORT ChangeRecord { | 46 struct SYNC_EXPORT ChangeRecord { |
| 46 enum Action { | 47 enum Action { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 59 sync_pb::EntitySpecifics specifics; | 60 sync_pb::EntitySpecifics specifics; |
| 60 linked_ptr<ExtraPasswordChangeRecordData> extra; | 61 linked_ptr<ExtraPasswordChangeRecordData> extra; |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 typedef std::vector<ChangeRecord> ChangeRecordList; | 64 typedef std::vector<ChangeRecord> ChangeRecordList; |
| 64 | 65 |
| 65 typedef Immutable<ChangeRecordList> ImmutableChangeRecordList; | 66 typedef Immutable<ChangeRecordList> ImmutableChangeRecordList; |
| 66 | 67 |
| 67 } // namespace syncer | 68 } // namespace syncer |
| 68 | 69 |
| 69 #endif // SYNC_INTERNAL_API_PUBLIC_CHANGE_RECORD_H_ | 70 #endif // COMPONENTS_SYNC_CORE_CHANGE_RECORD_H_ |
| OLD | NEW |