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