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

Side by Side Diff: sync/engine/update_handler.h

Issue 215973007: [Sync] Add plumbing of context from client to server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 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 SYNC_ENGINE_UPDATE_HANDLER_H_ 5 #ifndef SYNC_ENGINE_UPDATE_HANDLER_H_
6 #define SYNC_ENGINE_UPDATE_HANDLER_H_ 6 #define SYNC_ENGINE_UPDATE_HANDLER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "sync/base/sync_export.h" 10 #include "sync/base/sync_export.h"
11 11
12 namespace sync_pb { 12 namespace sync_pb {
13 class DataTypeContext;
13 class DataTypeProgressMarker; 14 class DataTypeProgressMarker;
14 class SyncEntity; 15 class SyncEntity;
15 } 16 }
16 17
17 typedef std::vector<const sync_pb::SyncEntity*> SyncEntityList; 18 typedef std::vector<const sync_pb::SyncEntity*> SyncEntityList;
18 19
19 namespace syncer { 20 namespace syncer {
20 21
21 namespace sessions { 22 namespace sessions {
22 class StatusController; 23 class StatusController;
23 } 24 }
24 25
25 class ModelSafeWorker; 26 class ModelSafeWorker;
26 27
27 // This class represents an entity that can request, receive, and apply updates 28 // This class represents an entity that can request, receive, and apply updates
28 // from the sync server. 29 // from the sync server.
29 class SYNC_EXPORT_PRIVATE UpdateHandler { 30 class SYNC_EXPORT_PRIVATE UpdateHandler {
30 public: 31 public:
31 UpdateHandler(); 32 UpdateHandler();
32 virtual ~UpdateHandler() = 0; 33 virtual ~UpdateHandler() = 0;
33 34
34 // Fills the given parameter with the stored progress marker for this type. 35 // Fills the given parameter with the stored progress marker for this type.
35 virtual void GetDownloadProgress( 36 virtual void GetDownloadProgress(
36 sync_pb::DataTypeProgressMarker* progress_marker) const = 0; 37 sync_pb::DataTypeProgressMarker* progress_marker) const = 0;
37 38
39 // Fills |context| with the per-client datatype context, if one exists. Clears
40 // |context| otherwise.
41 virtual void GetDataTypeContext(sync_pb::DataTypeContext* context) const = 0;
42
38 // Processes the contents of a GetUpdates response message. 43 // Processes the contents of a GetUpdates response message.
39 // 44 //
40 // Should be invoked with the progress marker and set of SyncEntities from a 45 // Should be invoked with the progress marker and set of SyncEntities from a
41 // single GetUpdates response message. The progress marker's type must match 46 // single GetUpdates response message. The progress marker's type must match
42 // this update handler's type, and the set of SyncEntities must include all 47 // this update handler's type, and the set of SyncEntities must include all
43 // entities of this type found in the response message. 48 // entities of this type found in the response message.
44 // 49 //
45 // In this context, "applicable_updates" means the set of updates belonging to 50 // In this context, "applicable_updates" means the set of updates belonging to
46 // this type. 51 // this type.
47 virtual void ProcessGetUpdatesResponse( 52 virtual void ProcessGetUpdatesResponse(
48 const sync_pb::DataTypeProgressMarker& progress_marker, 53 const sync_pb::DataTypeProgressMarker& progress_marker,
49 const SyncEntityList& applicable_updates, 54 const SyncEntityList& applicable_updates,
50 sessions::StatusController* status) = 0; 55 sessions::StatusController* status) = 0;
51 56
57 // Processes a server mutation of a datatype context.
58 virtual void ProcessDataTypeContextMutation(
59 const sync_pb::DataTypeContext& mutated_context) = 0;
60
52 // Called at the end of a non-configure GetUpdates loop to apply any unapplied 61 // Called at the end of a non-configure GetUpdates loop to apply any unapplied
53 // updates. 62 // updates.
54 virtual void ApplyUpdates(sessions::StatusController* status) = 0; 63 virtual void ApplyUpdates(sessions::StatusController* status) = 0;
55 64
56 // Called at the end of a configure GetUpdates loop to perform any required 65 // Called at the end of a configure GetUpdates loop to perform any required
57 // post-initial-download update application. 66 // post-initial-download update application.
58 virtual void PassiveApplyUpdates(sessions::StatusController* status) = 0; 67 virtual void PassiveApplyUpdates(sessions::StatusController* status) = 0;
59 }; 68 };
60 69
61 } // namespace syncer 70 } // namespace syncer
62 71
63 #endif // SYNC_ENGINE_UPDATE_HANDLER_H_ 72 #endif // SYNC_ENGINE_UPDATE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698