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

Unified Diff: components/sync_driver/generic_change_processor.h

Issue 548373003: Move AttachmentStore ownership to datatype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Changes after feedback. 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
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 a3139d8161a849c81425edc8309059800823e263..afd1ba3915158e62a71bb5c1a3312b76a994190a 100644
--- a/components/sync_driver/generic_change_processor.h
+++ b/components/sync_driver/generic_change_processor.h
@@ -45,12 +45,15 @@ class GenericChangeProcessor : public ChangeProcessor,
public base::NonThreadSafe {
public:
// Create a change processor and connect it to the syncer.
+ // |attachment_store| can be NULL which means that datatype will not use sync
+ // attachments.
GenericChangeProcessor(
DataTypeErrorHandler* error_handler,
const base::WeakPtr<syncer::SyncableService>& local_service,
const base::WeakPtr<syncer::SyncMergeResult>& merge_result,
syncer::UserShare* user_share,
- SyncApiComponentFactory* sync_factory);
+ SyncApiComponentFactory* sync_factory,
+ const scoped_refptr<syncer::AttachmentStore>& attachment_store);
virtual ~GenericChangeProcessor();
// ChangeProcessor interface.
@@ -161,12 +164,16 @@ class GenericChangeProcessor : public ChangeProcessor,
// and have to keep a local pointer to the user_share.
syncer::UserShare* const share_handle_;
+ // AttachmentService for datatype. Can be NULL if datatype doesn't use
+ // attachments.
scoped_ptr<syncer::AttachmentService> attachment_service_;
+
// Must be destroyed before attachment_service_ to ensure WeakPtrs are
// invalidated before attachment_service_ is destroyed.
- base::WeakPtrFactory<syncer::AttachmentService>
+ // Can be NULL if attachment_service_ is NULL;
+ scoped_ptr<base::WeakPtrFactory<syncer::AttachmentService> >
attachment_service_weak_ptr_factory_;
- syncer::AttachmentServiceProxy attachment_service_proxy_;
+ scoped_ptr<syncer::AttachmentServiceProxy> attachment_service_proxy_;
base::WeakPtrFactory<GenericChangeProcessor> weak_ptr_factory_;
« no previous file with comments | « components/sync_driver/fake_generic_change_processor.cc ('k') | components/sync_driver/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698