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