| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 SYNC_API_SYNC_CHANGE_PROCESSOR_H_ | 5 #ifndef SYNC_API_SYNC_CHANGE_PROCESSOR_H_ |
| 6 #define SYNC_API_SYNC_CHANGE_PROCESSOR_H_ | 6 #define SYNC_API_SYNC_CHANGE_PROCESSOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "sync/api/sync_error.h" | 11 #include "sync/api/sync_error.h" |
| 12 | 12 |
| 13 class SyncChange; | |
| 14 | |
| 15 namespace tracked_objects { | 13 namespace tracked_objects { |
| 16 class Location; | 14 class Location; |
| 17 } // namespace tracked_objects | 15 } // namespace tracked_objects |
| 18 | 16 |
| 17 namespace csync { |
| 18 |
| 19 class SyncChange; |
| 20 |
| 19 typedef std::vector<SyncChange> SyncChangeList; | 21 typedef std::vector<SyncChange> SyncChangeList; |
| 20 | 22 |
| 21 // An interface for services that handle receiving SyncChanges. | 23 // An interface for services that handle receiving SyncChanges. |
| 22 class SyncChangeProcessor { | 24 class SyncChangeProcessor { |
| 23 public: | 25 public: |
| 24 SyncChangeProcessor(); | 26 SyncChangeProcessor(); |
| 25 virtual ~SyncChangeProcessor(); | 27 virtual ~SyncChangeProcessor(); |
| 26 | 28 |
| 27 // Process a list of SyncChanges. | 29 // Process a list of SyncChanges. |
| 28 // Returns: A default SyncError (IsSet() == false) if no errors were | 30 // Returns: A default SyncError (IsSet() == false) if no errors were |
| 29 // encountered, and a filled SyncError (IsSet() == true) | 31 // encountered, and a filled SyncError (IsSet() == true) |
| 30 // otherwise. | 32 // otherwise. |
| 31 // Inputs: | 33 // Inputs: |
| 32 // |from_here|: allows tracking of where sync changes originate. | 34 // |from_here|: allows tracking of where sync changes originate. |
| 33 // |change_list|: is the list of sync changes in need of processing. | 35 // |change_list|: is the list of sync changes in need of processing. |
| 34 virtual SyncError ProcessSyncChanges( | 36 virtual SyncError ProcessSyncChanges( |
| 35 const tracked_objects::Location& from_here, | 37 const tracked_objects::Location& from_here, |
| 36 const SyncChangeList& change_list) = 0; | 38 const SyncChangeList& change_list) = 0; |
| 37 }; | 39 }; |
| 38 | 40 |
| 41 } // namespace csync |
| 42 |
| 39 #endif // SYNC_API_SYNC_CHANGE_PROCESSOR_H_ | 43 #endif // SYNC_API_SYNC_CHANGE_PROCESSOR_H_ |
| OLD | NEW |