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

Unified Diff: components/sync_driver/generic_change_processor.cc

Issue 986743004: [Sync] Refactor AttachmentStore classes. Introduce concept of referrer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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.cc
diff --git a/components/sync_driver/generic_change_processor.cc b/components/sync_driver/generic_change_processor.cc
index 60d9977b4dbdc060eb75e48c038c9745b04798e1..34e69791811c7cb5903491318c558544535b37a4 100644
--- a/components/sync_driver/generic_change_processor.cc
+++ b/components/sync_driver/generic_change_processor.cc
@@ -94,7 +94,7 @@ GenericChangeProcessor::GenericChangeProcessor(
const base::WeakPtr<syncer::SyncMergeResult>& merge_result,
syncer::UserShare* user_share,
SyncApiComponentFactory* sync_factory,
- const scoped_refptr<syncer::AttachmentStore>& attachment_store)
+ syncer::AttachmentStore* attachment_store)
: ChangeProcessor(error_handler),
type_(type),
local_service_(local_service),
@@ -103,14 +103,17 @@ GenericChangeProcessor::GenericChangeProcessor(
weak_ptr_factory_(this) {
DCHECK(CalledOnValidThread());
DCHECK_NE(type_, syncer::UNSPECIFIED);
- if (attachment_store.get()) {
+ if (attachment_store) {
+ scoped_ptr<syncer::AttachmentStore> attachment_store_for_sync =
+ attachment_store->CreateAttachmentStoreForSync();
std::string store_birthday;
{
syncer::ReadTransaction trans(FROM_HERE, share_handle());
store_birthday = trans.GetStoreBirthday();
}
attachment_service_ = sync_factory->CreateAttachmentService(
- attachment_store, *user_share, store_birthday, type, this);
+ attachment_store_for_sync.Pass(), *user_share, store_birthday, type,
+ this);
attachment_service_weak_ptr_factory_.reset(
new base::WeakPtrFactory<syncer::AttachmentService>(
attachment_service_.get()));

Powered by Google App Engine
This is Rietveld 408576698