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