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_ENGINE_VERIFY_UPDATES_COMMAND_H_ | 5 #ifndef SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ |
6 #define SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ | 6 #define SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "sync/engine/model_changing_syncer_command.h" | 10 #include "sync/engine/model_changing_syncer_command.h" |
11 #include "sync/engine/syncer_types.h" | 11 #include "sync/engine/syncer_types.h" |
12 #include "sync/engine/syncproto.h" | |
13 #include "sync/internal_api/public/engine/model_safe_worker.h" | 12 #include "sync/internal_api/public/engine/model_safe_worker.h" |
14 | 13 |
15 namespace syncer { | 14 namespace syncer { |
16 | 15 |
17 namespace syncable { | 16 namespace syncable { |
18 class WriteTransaction; | 17 class WriteTransaction; |
19 } | 18 } |
20 | 19 |
21 // Verifies the response from a GetUpdates request. All invalid updates will be | 20 // Verifies the response from a GetUpdates request. All invalid updates will be |
22 // noted in the SyncSession after this command is executed. | 21 // noted in the SyncSession after this command is executed. |
23 class VerifyUpdatesCommand : public ModelChangingSyncerCommand { | 22 class VerifyUpdatesCommand : public ModelChangingSyncerCommand { |
24 public: | 23 public: |
25 VerifyUpdatesCommand(); | 24 VerifyUpdatesCommand(); |
26 virtual ~VerifyUpdatesCommand(); | 25 virtual ~VerifyUpdatesCommand(); |
27 | 26 |
28 protected: | 27 protected: |
29 // ModelChangingSyncerCommand implementation. | 28 // ModelChangingSyncerCommand implementation. |
30 virtual std::set<ModelSafeGroup> GetGroupsToChange( | 29 virtual std::set<ModelSafeGroup> GetGroupsToChange( |
31 const sessions::SyncSession& session) const OVERRIDE; | 30 const sessions::SyncSession& session) const OVERRIDE; |
32 virtual SyncerError ModelChangingExecuteImpl( | 31 virtual SyncerError ModelChangingExecuteImpl( |
33 sessions::SyncSession* session) OVERRIDE; | 32 sessions::SyncSession* session) OVERRIDE; |
34 | 33 |
35 private: | 34 private: |
36 struct VerifyUpdateResult { | 35 struct VerifyUpdateResult { |
37 VerifyResult value; | 36 VerifyResult value; |
38 ModelSafeGroup placement; | 37 ModelSafeGroup placement; |
39 }; | 38 }; |
40 VerifyUpdateResult VerifyUpdate(syncable::WriteTransaction* trans, | 39 VerifyUpdateResult VerifyUpdate(syncable::WriteTransaction* trans, |
41 const SyncEntity& entry, | 40 const sync_pb::SyncEntity& entry, |
42 const syncer::ModelTypeSet& requested_types, | 41 const syncer::ModelTypeSet& requested_types, |
43 const ModelSafeRoutingInfo& routes); | 42 const ModelSafeRoutingInfo& routes); |
44 DISALLOW_COPY_AND_ASSIGN(VerifyUpdatesCommand); | 43 DISALLOW_COPY_AND_ASSIGN(VerifyUpdatesCommand); |
45 }; | 44 }; |
46 | 45 |
47 } // namespace syncer | 46 } // namespace syncer |
48 | 47 |
49 #endif // SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ | 48 #endif // SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ |
OLD | NEW |