Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: sync/api/sync_change_processor.h

Issue 23129007: sync: Add GetAllSyncData to sync/api (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 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 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "sync/api/sync_data.h"
10 #include "sync/api/sync_error.h" 11 #include "sync/api/sync_error.h"
11 #include "sync/base/sync_export.h" 12 #include "sync/base/sync_export.h"
13 #include "sync/internal_api/public/base/model_type.h"
12 14
13 namespace tracked_objects { 15 namespace tracked_objects {
14 class Location; 16 class Location;
15 } // namespace tracked_objects 17 } // namespace tracked_objects
16 18
17 namespace syncer { 19 namespace syncer {
18 20
19 class SyncChange; 21 class SyncChange;
20 22
21 typedef std::vector<SyncChange> SyncChangeList; 23 typedef std::vector<SyncChange> SyncChangeList;
22 24
23 // An interface for services that handle receiving SyncChanges. 25 // An interface for services that handle receiving SyncChanges.
24 class SYNC_EXPORT SyncChangeProcessor { 26 class SYNC_EXPORT SyncChangeProcessor {
25 public: 27 public:
26 SyncChangeProcessor(); 28 SyncChangeProcessor();
27 virtual ~SyncChangeProcessor(); 29 virtual ~SyncChangeProcessor();
28 30
29 // Process a list of SyncChanges. 31 // Process a list of SyncChanges.
30 // Returns: A default SyncError (IsSet() == false) if no errors were 32 // Returns: A default SyncError (IsSet() == false) if no errors were
31 // encountered, and a filled SyncError (IsSet() == true) 33 // encountered, and a filled SyncError (IsSet() == true)
32 // otherwise. 34 // otherwise.
33 // Inputs: 35 // Inputs:
34 // |from_here|: allows tracking of where sync changes originate. 36 // |from_here|: allows tracking of where sync changes originate.
35 // |change_list|: is the list of sync changes in need of processing. 37 // |change_list|: is the list of sync changes in need of processing.
36 virtual SyncError ProcessSyncChanges( 38 virtual SyncError ProcessSyncChanges(
37 const tracked_objects::Location& from_here, 39 const tracked_objects::Location& from_here,
38 const SyncChangeList& change_list) = 0; 40 const SyncChangeList& change_list) = 0;
41
42 // Fills a list of SyncData. This should create an up to date representation
43 // of all the data known to the ChangeProcessor for |datatype|, and
44 // should match/be a subset of the server's view of that datatype.
45 //
46 // WARNING: This can be a potentially slow & memory intensive operation and
47 // should only be used when absolutely necessary / sparingly.
48 virtual SyncDataList GetAllSyncData(ModelType type) const = 0;
haitaol1 2013/08/19 17:11:04 Should we care about error?
tim (not reviewing) 2013/08/19 18:03:08 I'm not sure it's worthwhile? My basic thinking wa
haitaol1 2013/08/19 21:20:06 ProcessSyncChanges() returns error. SyncableServic
39 }; 49 };
40 50
41 } // namespace syncer 51 } // namespace syncer
42 52
43 #endif // SYNC_API_SYNC_CHANGE_PROCESSOR_H_ 53 #endif // SYNC_API_SYNC_CHANGE_PROCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698