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 COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
6 #define COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 syncer::UserShare* user_share, | 55 syncer::UserShare* user_share, |
56 SyncApiComponentFactory* sync_factory, | 56 SyncApiComponentFactory* sync_factory, |
57 const scoped_refptr<syncer::AttachmentStore>& attachment_store); | 57 const scoped_refptr<syncer::AttachmentStore>& attachment_store); |
58 virtual ~GenericChangeProcessor(); | 58 virtual ~GenericChangeProcessor(); |
59 | 59 |
60 // ChangeProcessor interface. | 60 // ChangeProcessor interface. |
61 // Build and store a list of all changes into |syncer_changes_|. | 61 // Build and store a list of all changes into |syncer_changes_|. |
62 virtual void ApplyChangesFromSyncModel( | 62 virtual void ApplyChangesFromSyncModel( |
63 const syncer::BaseTransaction* trans, | 63 const syncer::BaseTransaction* trans, |
64 int64 version, | 64 int64 version, |
65 const syncer::ImmutableChangeRecordList& changes) OVERRIDE; | 65 const syncer::ImmutableChangeRecordList& changes) override; |
66 // Passes |syncer_changes_|, built in ApplyChangesFromSyncModel, onto | 66 // Passes |syncer_changes_|, built in ApplyChangesFromSyncModel, onto |
67 // |local_service_| by way of its ProcessSyncChanges method. | 67 // |local_service_| by way of its ProcessSyncChanges method. |
68 virtual void CommitChangesFromSyncModel() OVERRIDE; | 68 virtual void CommitChangesFromSyncModel() override; |
69 | 69 |
70 // syncer::SyncChangeProcessor implementation. | 70 // syncer::SyncChangeProcessor implementation. |
71 virtual syncer::SyncError ProcessSyncChanges( | 71 virtual syncer::SyncError ProcessSyncChanges( |
72 const tracked_objects::Location& from_here, | 72 const tracked_objects::Location& from_here, |
73 const syncer::SyncChangeList& change_list) OVERRIDE; | 73 const syncer::SyncChangeList& change_list) override; |
74 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) | 74 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) |
75 const OVERRIDE; | 75 const override; |
76 virtual syncer::SyncError UpdateDataTypeContext( | 76 virtual syncer::SyncError UpdateDataTypeContext( |
77 syncer::ModelType type, | 77 syncer::ModelType type, |
78 syncer::SyncChangeProcessor::ContextRefreshStatus refresh_status, | 78 syncer::SyncChangeProcessor::ContextRefreshStatus refresh_status, |
79 const std::string& context) OVERRIDE; | 79 const std::string& context) override; |
80 | 80 |
81 // syncer::AttachmentService::Delegate implementation. | 81 // syncer::AttachmentService::Delegate implementation. |
82 virtual void OnAttachmentUploaded( | 82 virtual void OnAttachmentUploaded( |
83 const syncer::AttachmentId& attachment_id) OVERRIDE; | 83 const syncer::AttachmentId& attachment_id) override; |
84 | 84 |
85 // Similar to above, but returns a SyncError for use by direct clients | 85 // Similar to above, but returns a SyncError for use by direct clients |
86 // of GenericChangeProcessor that may need more error visibility. | 86 // of GenericChangeProcessor that may need more error visibility. |
87 virtual syncer::SyncError GetAllSyncDataReturnError( | 87 virtual syncer::SyncError GetAllSyncDataReturnError( |
88 syncer::SyncDataList* data) const; | 88 syncer::SyncDataList* data) const; |
89 | 89 |
90 // If a datatype context associated with this GenericChangeProcessor's type | 90 // If a datatype context associated with this GenericChangeProcessor's type |
91 // exists, fills |context| and returns true. Otheriwse, if there has not been | 91 // exists, fills |context| and returns true. Otheriwse, if there has not been |
92 // a context set, returns false. | 92 // a context set, returns false. |
93 virtual bool GetDataTypeContext(std::string* context) const; | 93 virtual bool GetDataTypeContext(std::string* context) const; |
94 | 94 |
95 // Returns the number of items for this type. | 95 // Returns the number of items for this type. |
96 virtual int GetSyncCount(); | 96 virtual int GetSyncCount(); |
97 | 97 |
98 // Generic versions of AssociatorInterface methods. Called by | 98 // Generic versions of AssociatorInterface methods. Called by |
99 // syncer::SyncableServiceAdapter or the DataTypeController. | 99 // syncer::SyncableServiceAdapter or the DataTypeController. |
100 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); | 100 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); |
101 virtual bool CryptoReadyIfNecessary(); | 101 virtual bool CryptoReadyIfNecessary(); |
102 | 102 |
103 protected: | 103 protected: |
104 // ChangeProcessor interface. | 104 // ChangeProcessor interface. |
105 virtual void StartImpl() OVERRIDE; // Does nothing. | 105 virtual void StartImpl() override; // Does nothing. |
106 virtual syncer::UserShare* share_handle() const OVERRIDE; | 106 virtual syncer::UserShare* share_handle() const override; |
107 | 107 |
108 private: | 108 private: |
109 // Logically part of ProcessSyncChanges. | 109 // Logically part of ProcessSyncChanges. |
110 // | 110 // |
111 // |new_attachments| is an output parameter containing newly added attachments | 111 // |new_attachments| is an output parameter containing newly added attachments |
112 // that need to be stored. This method will append to it. | 112 // that need to be stored. This method will append to it. |
113 syncer::SyncError HandleActionAdd(const syncer::SyncChange& change, | 113 syncer::SyncError HandleActionAdd(const syncer::SyncChange& change, |
114 const std::string& type_str, | 114 const std::string& type_str, |
115 const syncer::WriteTransaction& trans, | 115 const syncer::WriteTransaction& trans, |
116 syncer::WriteNode* sync_node, | 116 syncer::WriteNode* sync_node, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 scoped_ptr<syncer::AttachmentServiceProxy> attachment_service_proxy_; | 167 scoped_ptr<syncer::AttachmentServiceProxy> attachment_service_proxy_; |
168 | 168 |
169 base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_; | 169 base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_; |
170 | 170 |
171 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); | 171 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); |
172 }; | 172 }; |
173 | 173 |
174 } // namespace sync_driver | 174 } // namespace sync_driver |
175 | 175 |
176 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 176 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
OLD | NEW |