OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ | |
6 #define CHROME_BROWSER_SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ | |
7 #pragma once | |
8 | |
9 #include "base/compiler_specific.h" | |
10 #include "chrome/browser/sync/engine/model_changing_syncer_command.h" | |
11 #include "chrome/browser/sync/engine/syncer_types.h" | |
12 | |
13 namespace syncable { | |
14 class WriteTransaction; | |
15 } | |
16 | |
17 namespace sync_pb { | |
18 class SyncEntity; | |
19 } | |
20 | |
21 namespace browser_sync { | |
22 | |
23 class Cryptographer; | |
24 | |
25 // A syncer command for processing updates. | |
26 // | |
27 // Preconditions - updates in the SyncerSesssion have been downloaded | |
28 // and verified. | |
29 // | |
30 // Postconditions - All of the verified SyncEntity data will be copied to | |
31 // the server fields of the corresponding syncable entries. | |
32 // TODO(tim): This should not be ModelChanging (bug 36592). | |
33 class ProcessUpdatesCommand : public ModelChangingSyncerCommand { | |
34 public: | |
35 ProcessUpdatesCommand(); | |
36 virtual ~ProcessUpdatesCommand(); | |
37 | |
38 protected: | |
39 // ModelChangingSyncerCommand implementation. | |
40 virtual std::set<ModelSafeGroup> GetGroupsToChange( | |
41 const sessions::SyncSession& session) const OVERRIDE; | |
42 virtual SyncerError ModelChangingExecuteImpl( | |
43 sessions::SyncSession* session) OVERRIDE; | |
44 | |
45 private: | |
46 ServerUpdateProcessingResult ProcessUpdate( | |
47 const sync_pb::SyncEntity& proto_update, | |
48 const Cryptographer* cryptographer, | |
49 syncable::WriteTransaction* const trans); | |
50 DISALLOW_COPY_AND_ASSIGN(ProcessUpdatesCommand); | |
51 }; | |
52 | |
53 } // namespace browser_sync | |
54 | |
55 #endif // CHROME_BROWSER_SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ | |
OLD | NEW |