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