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

Unified Diff: components/sync_driver/generic_change_processor.cc

Issue 272043002: Invoke AttachmentUploader and update AttachmentIds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android build Created 6 years, 7 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 75ed37389f8f9ac2b29ab71d1381dfa943a30c7c..6341ab296c2d8733dc88156fe0c1905ac098c380 100644
--- a/components/sync_driver/generic_change_processor.cc
+++ b/components/sync_driver/generic_change_processor.cc
@@ -7,6 +7,7 @@
#include "base/location.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "components/sync_driver/sync_api_component_factory.h"
#include "sync/api/sync_change.h"
#include "sync/api/sync_error.h"
#include "sync/api/syncable_service.h"
@@ -91,12 +92,12 @@ GenericChangeProcessor::GenericChangeProcessor(
const base::WeakPtr<syncer::SyncableService>& local_service,
const base::WeakPtr<syncer::SyncMergeResult>& merge_result,
syncer::UserShare* user_share,
- scoped_ptr<syncer::AttachmentService> attachment_service)
+ SyncApiComponentFactory* sync_factory)
: ChangeProcessor(error_handler),
local_service_(local_service),
merge_result_(merge_result),
share_handle_(user_share),
- attachment_service_(attachment_service.Pass()),
+ attachment_service_(sync_factory->CreateAttachmentService(this)),
attachment_service_weak_ptr_factory_(attachment_service_.get()),
attachment_service_proxy_(
base::MessageLoopProxy::current(),
@@ -209,6 +210,12 @@ syncer::SyncError GenericChangeProcessor::UpdateDataTypeContext(
return syncer::SyncError();
}
+void GenericChangeProcessor::OnAttachmentUploaded(
+ const syncer::AttachmentId& attachment_id) {
+ syncer::WriteTransaction trans(FROM_HERE, share_handle());
+ trans.UpdateEntriesWithAttachmentId(attachment_id);
+}
+
syncer::SyncError GenericChangeProcessor::GetAllSyncDataReturnError(
syncer::ModelType type,
syncer::SyncDataList* current_sync_data) const {
« no previous file with comments | « components/sync_driver/generic_change_processor.h ('k') | components/sync_driver/generic_change_processor_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698