OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_SYNC_DRIVER_SHARED_CHANGE_PROCESSOR_REF_H_ | |
6 #define COMPONENTS_SYNC_DRIVER_SHARED_CHANGE_PROCESSOR_REF_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/compiler_specific.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "components/sync/api/sync_change_processor.h" | |
13 #include "components/sync/api/sync_error_factory.h" | |
14 #include "components/sync_driver/shared_change_processor.h" | |
15 | |
16 namespace sync_driver { | |
17 | |
18 // A syncer::SyncChangeProcessor stub for interacting with a refcounted | |
19 // SharedChangeProcessor. | |
20 class SharedChangeProcessorRef : public syncer::SyncChangeProcessor, | |
21 public syncer::SyncErrorFactory { | |
22 public: | |
23 SharedChangeProcessorRef( | |
24 const scoped_refptr<SharedChangeProcessor>& | |
25 change_processor); | |
26 ~SharedChangeProcessorRef() override; | |
27 | |
28 // syncer::SyncChangeProcessor implementation. | |
29 syncer::SyncError ProcessSyncChanges( | |
30 const tracked_objects::Location& from_here, | |
31 const syncer::SyncChangeList& change_list) override; | |
32 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; | |
33 syncer::SyncError UpdateDataTypeContext( | |
34 syncer::ModelType type, | |
35 syncer::SyncChangeProcessor::ContextRefreshStatus refresh_status, | |
36 const std::string& context) override; | |
37 | |
38 // syncer::SyncErrorFactory implementation. | |
39 syncer::SyncError CreateAndUploadError( | |
40 const tracked_objects::Location& from_here, | |
41 const std::string& message) override; | |
42 | |
43 // Default copy and assign welcome (and safe due to refcounted-ness). | |
44 | |
45 private: | |
46 scoped_refptr<SharedChangeProcessor> change_processor_; | |
47 }; | |
48 | |
49 } // namespace sync_driver | |
50 | |
51 #endif // COMPONENTS_SYNC_DRIVER_SHARED_CHANGE_PROCESSOR_REF_H_ | |
OLD | NEW |