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

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

Issue 2769113002: [Sync] Stop accessing BrowserContextKeyedServiceFactory on non-UI thread. (Closed)
Patch Set: Rebase and removing dependent patch set. Created 3 years, 8 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/base/model_type.h" 12 #include "components/sync/base/model_type.h"
13 #include "components/sync/driver/generic_change_processor.h" 13 #include "components/sync/driver/generic_change_processor.h"
14 #include "components/sync/driver/generic_change_processor_factory.h" 14 #include "components/sync/driver/generic_change_processor_factory.h"
15 #include "components/sync/driver/sync_api_component_factory.h" 15 #include "components/sync/driver/sync_api_component_factory.h"
16 #include "components/sync/model/sync_error.h" 16 #include "components/sync/model/sync_error.h"
17 17
18 namespace syncer { 18 namespace syncer {
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 explicit FakeGenericChangeProcessor(ModelType type);
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 SyncError ProcessSyncChanges(const tracked_objects::Location& from_here,
32 const SyncChangeList& change_list) override; 32 const SyncChangeList& change_list) override;
33 SyncError GetAllSyncDataReturnError(SyncDataList* data) const override; 33 SyncError GetAllSyncDataReturnError(SyncDataList* data) const override;
(...skipping 12 matching lines...) Expand all
46 public: 46 public:
47 explicit FakeGenericChangeProcessorFactory( 47 explicit FakeGenericChangeProcessorFactory(
48 std::unique_ptr<FakeGenericChangeProcessor> processor); 48 std::unique_ptr<FakeGenericChangeProcessor> processor);
49 ~FakeGenericChangeProcessorFactory() override; 49 ~FakeGenericChangeProcessorFactory() override;
50 std::unique_ptr<GenericChangeProcessor> CreateGenericChangeProcessor( 50 std::unique_ptr<GenericChangeProcessor> CreateGenericChangeProcessor(
51 ModelType type, 51 ModelType type,
52 UserShare* user_share, 52 UserShare* user_share,
53 std::unique_ptr<DataTypeErrorHandler> error_handler, 53 std::unique_ptr<DataTypeErrorHandler> error_handler,
54 const base::WeakPtr<SyncableService>& local_service, 54 const base::WeakPtr<SyncableService>& local_service,
55 const base::WeakPtr<SyncMergeResult>& merge_result, 55 const base::WeakPtr<SyncMergeResult>& merge_result,
56 SyncClient* sync_client) override; 56 SyncApiComponentFactory* driver_factory) override;
57 57
58 private: 58 private:
59 std::unique_ptr<FakeGenericChangeProcessor> processor_; 59 std::unique_ptr<FakeGenericChangeProcessor> processor_;
60 DISALLOW_COPY_AND_ASSIGN(FakeGenericChangeProcessorFactory); 60 DISALLOW_COPY_AND_ASSIGN(FakeGenericChangeProcessorFactory);
61 }; 61 };
62 62
63 } // namespace syncer 63 } // namespace syncer
64 64
65 #endif // COMPONENTS_SYNC_DRIVER_FAKE_GENERIC_CHANGE_PROCESSOR_H_ 65 #endif // COMPONENTS_SYNC_DRIVER_FAKE_GENERIC_CHANGE_PROCESSOR_H_
OLDNEW
« no previous file with comments | « components/sync/driver/directory_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