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

Side by Side Diff: components/sync/driver/fake_generic_change_processor.h

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SYNC_DRIVER_FAKE_GENERIC_CHANGE_PROCESSOR_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_FAKE_GENERIC_CHANGE_PROCESSOR_H_
6 #define COMPONENTS_SYNC_DRIVER_FAKE_GENERIC_CHANGE_PROCESSOR_H_ 6 #define COMPONENTS_SYNC_DRIVER_FAKE_GENERIC_CHANGE_PROCESSOR_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "components/sync/api/sync_error.h" 12 #include "components/sync/api/sync_error.h"
13 #include "components/sync/base/model_type.h" 13 #include "components/sync/base/model_type.h"
14 #include "components/sync/driver/generic_change_processor.h" 14 #include "components/sync/driver/generic_change_processor.h"
15 #include "components/sync/driver/generic_change_processor_factory.h" 15 #include "components/sync/driver/generic_change_processor_factory.h"
16 #include "components/sync/driver/sync_api_component_factory.h" 16 #include "components/sync/driver/sync_api_component_factory.h"
17 17
18 namespace syncer { 18 namespace sync_driver {
19 19
20 // A fake GenericChangeProcessor that can return arbitrary values. 20 // A fake GenericChangeProcessor that can return arbitrary values.
21 class FakeGenericChangeProcessor : public GenericChangeProcessor { 21 class FakeGenericChangeProcessor : public GenericChangeProcessor {
22 public: 22 public:
23 FakeGenericChangeProcessor(ModelType type, SyncClient* sync_client); 23 FakeGenericChangeProcessor(syncer::ModelType type, SyncClient* sync_client);
24 ~FakeGenericChangeProcessor() override; 24 ~FakeGenericChangeProcessor() override;
25 25
26 // Setters for GenericChangeProcessor implementation results. 26 // Setters for GenericChangeProcessor implementation results.
27 void set_sync_model_has_user_created_nodes(bool has_nodes); 27 void set_sync_model_has_user_created_nodes(bool has_nodes);
28 void set_sync_model_has_user_created_nodes_success(bool success); 28 void set_sync_model_has_user_created_nodes_success(bool success);
29 29
30 // GenericChangeProcessor implementations. 30 // GenericChangeProcessor implementations.
31 SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, 31 syncer::SyncError ProcessSyncChanges(
32 const SyncChangeList& change_list) override; 32 const tracked_objects::Location& from_here,
33 SyncError GetAllSyncDataReturnError(SyncDataList* data) const override; 33 const syncer::SyncChangeList& change_list) override;
34 syncer::SyncError GetAllSyncDataReturnError(
35 syncer::SyncDataList* data) const override;
34 bool GetDataTypeContext(std::string* context) const override; 36 bool GetDataTypeContext(std::string* context) const override;
35 int GetSyncCount() override; 37 int GetSyncCount() override;
36 bool SyncModelHasUserCreatedNodes(bool* has_nodes) override; 38 bool SyncModelHasUserCreatedNodes(bool* has_nodes) override;
37 bool CryptoReadyIfNecessary() override; 39 bool CryptoReadyIfNecessary() override;
38 40
39 private: 41 private:
40 bool sync_model_has_user_created_nodes_; 42 bool sync_model_has_user_created_nodes_;
41 bool sync_model_has_user_created_nodes_success_; 43 bool sync_model_has_user_created_nodes_success_;
42 }; 44 };
43 45
44 // Define a factory for FakeGenericChangeProcessor for convenience. 46 // Define a factory for FakeGenericChangeProcessor for convenience.
45 class FakeGenericChangeProcessorFactory : public GenericChangeProcessorFactory { 47 class FakeGenericChangeProcessorFactory : public GenericChangeProcessorFactory {
46 public: 48 public:
47 explicit FakeGenericChangeProcessorFactory( 49 explicit FakeGenericChangeProcessorFactory(
48 std::unique_ptr<FakeGenericChangeProcessor> processor); 50 std::unique_ptr<FakeGenericChangeProcessor> processor);
49 ~FakeGenericChangeProcessorFactory() override; 51 ~FakeGenericChangeProcessorFactory() override;
50 std::unique_ptr<GenericChangeProcessor> CreateGenericChangeProcessor( 52 std::unique_ptr<GenericChangeProcessor> CreateGenericChangeProcessor(
51 ModelType type, 53 syncer::ModelType type,
52 UserShare* user_share, 54 syncer::UserShare* user_share,
53 std::unique_ptr<DataTypeErrorHandler> error_handler, 55 std::unique_ptr<syncer::DataTypeErrorHandler> error_handler,
54 const base::WeakPtr<SyncableService>& local_service, 56 const base::WeakPtr<syncer::SyncableService>& local_service,
55 const base::WeakPtr<SyncMergeResult>& merge_result, 57 const base::WeakPtr<syncer::SyncMergeResult>& merge_result,
56 SyncClient* sync_client) override; 58 SyncClient* sync_client) override;
57 59
58 private: 60 private:
59 std::unique_ptr<FakeGenericChangeProcessor> processor_; 61 std::unique_ptr<FakeGenericChangeProcessor> processor_;
60 DISALLOW_COPY_AND_ASSIGN(FakeGenericChangeProcessorFactory); 62 DISALLOW_COPY_AND_ASSIGN(FakeGenericChangeProcessorFactory);
61 }; 63 };
62 64
63 } // namespace syncer 65 } // namespace sync_driver
64 66
65 #endif // COMPONENTS_SYNC_DRIVER_FAKE_GENERIC_CHANGE_PROCESSOR_H_ 67 #endif // COMPONENTS_SYNC_DRIVER_FAKE_GENERIC_CHANGE_PROCESSOR_H_
OLDNEW
« no previous file with comments | « components/sync/driver/fake_data_type_controller.cc ('k') | components/sync/driver/fake_generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698