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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, |
117 syncer::AttachmentIdList* new_attachments); | 117 syncer::AttachmentIdSet* new_attachments); |
118 | 118 |
119 // Logically part of ProcessSyncChanges. | 119 // Logically part of ProcessSyncChanges. |
120 // | 120 // |
121 // |new_attachments| is an output parameter containing newly added attachments | 121 // |new_attachments| is an output parameter containing newly added attachments |
122 // that need to be stored. This method will append to it. | 122 // that need to be stored. This method will append to it. |
123 syncer::SyncError HandleActionUpdate( | 123 syncer::SyncError HandleActionUpdate( |
124 const syncer::SyncChange& change, | 124 const syncer::SyncChange& change, |
125 const std::string& type_str, | 125 const std::string& type_str, |
126 const syncer::WriteTransaction& trans, | 126 const syncer::WriteTransaction& trans, |
127 syncer::WriteNode* sync_node, | 127 syncer::WriteNode* sync_node, |
128 syncer::AttachmentIdList* new_attachments); | 128 syncer::AttachmentIdSet* new_attachments); |
129 | 129 |
130 // Upload |attachments| to the sync server. | 130 // Begin uploading attachments that have not yet been uploaded to the sync |
131 // | 131 // server. |
132 // This function assumes that attachments were already stored in | 132 void UploadAllAttachmentsNotOnServer(); |
133 // AttachmentStore. | |
134 void UploadAttachments(const syncer::AttachmentIdList& attachment_ids); | |
135 | 133 |
136 const syncer::ModelType type_; | 134 const syncer::ModelType type_; |
137 | 135 |
138 // The SyncableService this change processor will forward changes on to. | 136 // The SyncableService this change processor will forward changes on to. |
139 const base::WeakPtr<syncer::SyncableService> local_service_; | 137 const base::WeakPtr<syncer::SyncableService> local_service_; |
140 | 138 |
141 // A SyncMergeResult used to track the changes made during association. The | 139 // A SyncMergeResult used to track the changes made during association. The |
142 // owner will invalidate the weak pointer when association is complete. While | 140 // owner will invalidate the weak pointer when association is complete. While |
143 // the pointer is valid though, we increment it with any changes received | 141 // the pointer is valid though, we increment it with any changes received |
144 // via ProcessSyncChanges. | 142 // via ProcessSyncChanges. |
(...skipping 24 matching lines...) Expand all Loading... |
169 scoped_ptr<syncer::AttachmentServiceProxy> attachment_service_proxy_; | 167 scoped_ptr<syncer::AttachmentServiceProxy> attachment_service_proxy_; |
170 | 168 |
171 base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_; | 169 base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_; |
172 | 170 |
173 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); | 171 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); |
174 }; | 172 }; |
175 | 173 |
176 } // namespace sync_driver | 174 } // namespace sync_driver |
177 | 175 |
178 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ | 176 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ |
OLD | NEW |