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

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: Don't create AttachmentService in GenericChangeProcessor if AttachmentStore is NULL 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 19416004455e55c8c1e43345ff1aba1a3b367994..e1b4fa3d6ae4da4a865103a217c9f311a9ed56d9 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"
@@ -49,7 +50,8 @@ class GenericChangeProcessor : public ChangeProcessor,
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);
maniscalco 2014/09/08 21:56:35 nit: Document that attachment_store can be null.
pavely 2014/09/09 23:52:30 Done.
virtual ~GenericChangeProcessor();
// ChangeProcessor interface.
@@ -151,9 +153,9 @@ class GenericChangeProcessor : public ChangeProcessor,
scoped_ptr<syncer::AttachmentService> attachment_service_;
maniscalco 2014/09/08 21:56:35 Can you note that attaachment_service_ may be null
pavely 2014/09/09 23:52:30 Done.
// Must be destroyed before attachment_service_ to ensure WeakPtrs are
// invalidated before attachment_service_ is destroyed.
- base::WeakPtrFactory<syncer::AttachmentService>
+ scoped_ptr<base::WeakPtrFactory<syncer::AttachmentService> >
maniscalco 2014/09/08 21:56:35 It's probably worth noting that attachment_service
pavely 2014/09/09 23:52:30 Done.
attachment_service_weak_ptr_factory_;
- syncer::AttachmentServiceProxy attachment_service_proxy_;
+ scoped_ptr<syncer::AttachmentServiceProxy> attachment_service_proxy_;
DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor);
};

Powered by Google App Engine
This is Rietveld 408576698