OLD | NEW |
1 // Copyright (c) 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_ENGINE_PROCESS_UPDATES_COMMAND_H_ | 5 #ifndef SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ |
6 #define SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ | 6 #define SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "sync/base/sync_export.h" |
9 #include "sync/engine/model_changing_syncer_command.h" | 10 #include "sync/engine/model_changing_syncer_command.h" |
10 #include "sync/engine/syncer_types.h" | 11 #include "sync/engine/syncer_types.h" |
11 | 12 |
12 namespace sync_pb { | 13 namespace sync_pb { |
13 class SyncEntity; | 14 class SyncEntity; |
14 } | 15 } |
15 | 16 |
16 namespace syncer { | 17 namespace syncer { |
17 | 18 |
18 namespace syncable { | 19 namespace syncable { |
19 class WriteTransaction; | 20 class WriteTransaction; |
20 } | 21 } |
21 | 22 |
22 class Cryptographer; | 23 class Cryptographer; |
23 | 24 |
24 // A syncer command for verifying and processing updates. | 25 // A syncer command for verifying and processing updates. |
25 // | 26 // |
26 // Preconditions - Updates in the SyncerSesssion have been downloaded. | 27 // Preconditions - Updates in the SyncerSesssion have been downloaded. |
27 // | 28 // |
28 // Postconditions - All of the verified SyncEntity data will be copied to | 29 // Postconditions - All of the verified SyncEntity data will be copied to |
29 // the server fields of the corresponding syncable entries. | 30 // the server fields of the corresponding syncable entries. |
30 class ProcessUpdatesCommand : public ModelChangingSyncerCommand { | 31 class SYNC_EXPORT_PRIVATE ProcessUpdatesCommand |
| 32 : public ModelChangingSyncerCommand { |
31 public: | 33 public: |
32 ProcessUpdatesCommand(); | 34 ProcessUpdatesCommand(); |
33 virtual ~ProcessUpdatesCommand(); | 35 virtual ~ProcessUpdatesCommand(); |
34 | 36 |
35 protected: | 37 protected: |
36 // ModelChangingSyncerCommand implementation. | 38 // ModelChangingSyncerCommand implementation. |
37 virtual std::set<ModelSafeGroup> GetGroupsToChange( | 39 virtual std::set<ModelSafeGroup> GetGroupsToChange( |
38 const sessions::SyncSession& session) const OVERRIDE; | 40 const sessions::SyncSession& session) const OVERRIDE; |
39 virtual SyncerError ModelChangingExecuteImpl( | 41 virtual SyncerError ModelChangingExecuteImpl( |
40 sessions::SyncSession* session) OVERRIDE; | 42 sessions::SyncSession* session) OVERRIDE; |
41 | 43 |
42 private: | 44 private: |
43 VerifyResult VerifyUpdate( | 45 VerifyResult VerifyUpdate( |
44 syncable::WriteTransaction* trans, | 46 syncable::WriteTransaction* trans, |
45 const sync_pb::SyncEntity& entry, | 47 const sync_pb::SyncEntity& entry, |
46 ModelTypeSet requested_types, | 48 ModelTypeSet requested_types, |
47 const ModelSafeRoutingInfo& routes); | 49 const ModelSafeRoutingInfo& routes); |
48 ServerUpdateProcessingResult ProcessUpdate( | 50 ServerUpdateProcessingResult ProcessUpdate( |
49 const sync_pb::SyncEntity& proto_update, | 51 const sync_pb::SyncEntity& proto_update, |
50 const Cryptographer* cryptographer, | 52 const Cryptographer* cryptographer, |
51 syncable::WriteTransaction* const trans); | 53 syncable::WriteTransaction* const trans); |
52 DISALLOW_COPY_AND_ASSIGN(ProcessUpdatesCommand); | 54 DISALLOW_COPY_AND_ASSIGN(ProcessUpdatesCommand); |
53 }; | 55 }; |
54 | 56 |
55 } // namespace syncer | 57 } // namespace syncer |
56 | 58 |
57 #endif // SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ | 59 #endif // SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ |
OLD | NEW |