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

Unified Diff: components/sync/model/recording_model_type_change_processor.cc

Issue 2856933005: [Sync] Create UserEventSyncBridge. (Closed)
Patch Set: Removing autocomplete_sync_bridge_unittest.cc from cl. Created 3 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/model/recording_model_type_change_processor.cc
diff --git a/components/sync/model/recording_model_type_change_processor.cc b/components/sync/model/recording_model_type_change_processor.cc
index 0d379747de9e855cecb81cc841c8de0dd28c7620..e74e44f451aa1fe9cf4b0ee4af8e3457d3e77ece 100644
--- a/components/sync/model/recording_model_type_change_processor.cc
+++ b/components/sync/model/recording_model_type_change_processor.cc
@@ -6,10 +6,27 @@
#include <utility>
+#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "components/sync/model/metadata_batch.h"
namespace syncer {
+namespace {
+
+std::unique_ptr<ModelTypeChangeProcessor> CreateAndAssignProcessor(
+ RecordingModelTypeChangeProcessor** processor_address,
+ ModelType type,
+ ModelTypeSyncBridge* bridge) {
+ auto processor = base::MakeUnique<RecordingModelTypeChangeProcessor>();
+ *processor_address = processor.get();
+ // Not all compilers are smart enough to up cast during copy elision, so we
+ // explicitly create a correctly typed unique_ptr.
+ return base::WrapUnique(processor.release());
+}
+
+} // namespace
+
RecordingModelTypeChangeProcessor::RecordingModelTypeChangeProcessor() {}
RecordingModelTypeChangeProcessor::~RecordingModelTypeChangeProcessor() {}
@@ -41,4 +58,12 @@ void RecordingModelTypeChangeProcessor::SetIsTrackingMetadata(
is_tracking_metadata_ = is_tracking;
}
+// static
+ModelTypeSyncBridge::ChangeProcessorFactory
+RecordingModelTypeChangeProcessor::FactoryForBridgeTest(
+ RecordingModelTypeChangeProcessor** processor_address) {
+ return base::Bind(&CreateAndAssignProcessor,
+ base::Unretained(processor_address));
+}
+
} // namespace syncer
« no previous file with comments | « components/sync/model/recording_model_type_change_processor.h ('k') | components/sync/protocol/user_event_specifics.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698