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

Unified Diff: sync/api/sync_change_processor_delegator.h

Issue 151963002: Remove duplicated code from sync related unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename SyncChangeProcessorDelgate to SyncChangeProcessorDelgator. Created 6 years, 11 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: sync/api/sync_change_processor_delegator.h
diff --git a/sync/api/sync_change_processor_delegator.h b/sync/api/sync_change_processor_delegator.h
new file mode 100644
index 0000000000000000000000000000000000000000..d0cf876f52133de149789ae5a1367496a3cf0087
--- /dev/null
+++ b/sync/api/sync_change_processor_delegator.h
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYNC_API_SYNC_CHANGE_PROCESSOR_DELEGATOR_H_
+#define SYNC_API_SYNC_CHANGE_PROCESSOR_DELEGATOR_H_
+
+#include "sync/api/sync_change_processor.h"
+
+namespace syncer {
+
+// A delegator for use in unit tests.
tim (not reviewing) 2014/02/06 19:26:47 Let's put Test in the name of this class somehow t
maniscalco 2014/02/06 20:05:27 Good idea. Renamed to SyncChangeProcessorWrapperF
+class SyncChangeProcessorDelegator : public SyncChangeProcessor {
+ public:
+ // Create a SyncChangeProcessorDelegator.
+ //
+ // All method calls are forwarded to |recipient|. Caller maintains ownership
+ // of |recipient| and is responsible for ensuring it outlives this object.
+ SyncChangeProcessorDelegator(syncer::SyncChangeProcessor* recipient);
tim (not reviewing) 2014/02/06 19:26:47 single arg constructors should be explicit.
maniscalco 2014/02/06 20:05:27 Done.
+ virtual ~SyncChangeProcessorDelegator();
+
+ // SyncChangeProcessor implementation.
+ virtual syncer::SyncError ProcessSyncChanges(
+ const tracked_objects::Location& from_here,
+ const syncer::SyncChangeList& change_list) OVERRIDE;
+ virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type)
+ const OVERRIDE;
+
+ private:
+ syncer::SyncChangeProcessor* const recipient_;
tim (not reviewing) 2014/02/06 19:26:47 nit - wrapped_ might be a better name.
maniscalco 2014/02/06 20:05:27 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(SyncChangeProcessorDelegator);
+};
+
+} // namespace syncer
+
+#endif // SYNC_API_SYNC_CHANGE_PROCESSOR_DELEGATOR_H_

Powered by Google App Engine
This is Rietveld 408576698