OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ |
6 #define CHROME_BROWSER_SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ | 6 #define CHROME_BROWSER_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 | 10 #include "base/compiler_specific.h" |
11 #include "chrome/browser/sync/engine/model_safe_worker.h" | 11 #include "chrome/browser/sync/engine/model_safe_worker.h" |
12 #include "chrome/browser/sync/engine/model_changing_syncer_command.h" | 12 #include "chrome/browser/sync/engine/model_changing_syncer_command.h" |
13 #include "chrome/browser/sync/engine/syncproto.h" | 13 #include "chrome/browser/sync/engine/syncproto.h" |
14 #include "chrome/browser/sync/engine/syncer_types.h" | 14 #include "chrome/browser/sync/engine/syncer_types.h" |
15 | 15 |
16 namespace syncable { | 16 namespace syncable { |
17 class WriteTransaction; | 17 class WriteTransaction; |
18 } | 18 } |
19 | 19 |
20 namespace browser_sync { | 20 namespace browser_sync { |
21 | 21 |
22 // Verifies the response from a GetUpdates request. All invalid updates will be | 22 // Verifies the response from a GetUpdates request. All invalid updates will be |
23 // noted in the SyncSession after this command is executed. | 23 // noted in the SyncSession after this command is executed. |
24 class VerifyUpdatesCommand : public ModelChangingSyncerCommand { | 24 class VerifyUpdatesCommand : public ModelChangingSyncerCommand { |
25 public: | 25 public: |
26 VerifyUpdatesCommand(); | 26 VerifyUpdatesCommand(); |
27 virtual ~VerifyUpdatesCommand(); | 27 virtual ~VerifyUpdatesCommand(); |
28 | 28 |
29 // SyncerCommand implementation. | 29 // SyncerCommand implementation. |
30 virtual void ModelChangingExecuteImpl(sessions::SyncSession* session); | 30 virtual void ModelChangingExecuteImpl( |
| 31 sessions::SyncSession* session) OVERRIDE; |
31 | 32 |
32 private: | 33 private: |
33 struct VerifyUpdateResult { | 34 struct VerifyUpdateResult { |
34 VerifyResult value; | 35 VerifyResult value; |
35 ModelSafeGroup placement; | 36 ModelSafeGroup placement; |
36 }; | 37 }; |
37 VerifyUpdateResult VerifyUpdate(syncable::WriteTransaction* trans, | 38 VerifyUpdateResult VerifyUpdate(syncable::WriteTransaction* trans, |
38 const SyncEntity& entry, | 39 const SyncEntity& entry, |
39 const ModelSafeRoutingInfo& routes); | 40 const ModelSafeRoutingInfo& routes); |
40 DISALLOW_COPY_AND_ASSIGN(VerifyUpdatesCommand); | 41 DISALLOW_COPY_AND_ASSIGN(VerifyUpdatesCommand); |
41 }; | 42 }; |
42 | 43 |
43 } // namespace browser_sync | 44 } // namespace browser_sync |
44 | 45 |
45 #endif // CHROME_BROWSER_SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ | 46 #endif // CHROME_BROWSER_SYNC_ENGINE_VERIFY_UPDATES_COMMAND_H_ |
OLD | NEW |