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

Unified Diff: components/sync_driver/generic_change_processor.h

Issue 548533003: Replace AttachmentStore's StoreAttachments with UploadAttachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call get() on scoped_refptr. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/sync_driver/generic_change_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/generic_change_processor.h
diff --git a/components/sync_driver/generic_change_processor.h b/components/sync_driver/generic_change_processor.h
index 19416004455e55c8c1e43345ff1aba1a3b367994..a3139d8161a849c81425edc8309059800823e263 100644
--- a/components/sync_driver/generic_change_processor.h
+++ b/components/sync_driver/generic_change_processor.h
@@ -13,6 +13,7 @@
#include "components/sync_driver/change_processor.h"
#include "components/sync_driver/data_type_controller.h"
#include "components/sync_driver/data_type_error_handler.h"
+#include "sync/api/attachments/attachment_store.h"
#include "sync/api/sync_change_processor.h"
#include "sync/api/sync_merge_result.h"
#include "sync/internal_api/public/attachments/attachment_service.h"
@@ -126,6 +127,18 @@ class GenericChangeProcessor : public ChangeProcessor,
syncer::WriteNode* sync_node,
syncer::AttachmentList* new_attachments);
+ // Store |attachments| locally then upload them to the sync server.
+ //
+ // Store and uploading are asynchronous operations. |WriteAttachmentsDone|
+ // will be invoked once the attachments have been stored on the local device.
+ void StoreAndUploadAttachments(const syncer::AttachmentList& attachments);
+
+ // Invoked once attachments have been stored locally.
+ //
+ // See also AttachmentStore::WriteCallback.
+ void WriteAttachmentsDone(const syncer::AttachmentList& attachments,
+ const syncer::AttachmentStore::Result& result);
+
// The SyncableService this change processor will forward changes on to.
const base::WeakPtr<syncer::SyncableService> local_service_;
@@ -155,6 +168,8 @@ class GenericChangeProcessor : public ChangeProcessor,
attachment_service_weak_ptr_factory_;
syncer::AttachmentServiceProxy attachment_service_proxy_;
+ base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor);
};
« 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