Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: components/sync_driver/generic_change_processor.h

Issue 582913002: Make GenericChangeProcessor upload attachments on startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/sync_driver/generic_change_processor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | components/sync_driver/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698