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
3 // found in the LICENSE file.
5 #ifndef SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_
6 #define SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_
8 #include "base/compiler_specific.h"
9 #include "sync/base/sync_export.h"
10 #include "sync/engine/model_changing_syncer_command.h"
11 #include "sync/engine/syncer_types.h"
20 class WriteTransaction
;
25 // A syncer command for verifying and processing updates.
27 // Preconditions - Updates in the SyncerSesssion have been downloaded.
29 // Postconditions - All of the verified SyncEntity data will be copied to
30 // the server fields of the corresponding syncable entries.
31 class SYNC_EXPORT_PRIVATE ProcessUpdatesCommand
32 : public ModelChangingSyncerCommand
{
34 ProcessUpdatesCommand();
35 virtual ~ProcessUpdatesCommand();
38 // ModelChangingSyncerCommand implementation.
39 virtual std::set
<ModelSafeGroup
> GetGroupsToChange(
40 const sessions::SyncSession
& session
) const OVERRIDE
;
41 virtual SyncerError
ModelChangingExecuteImpl(
42 sessions::SyncSession
* session
) OVERRIDE
;
45 VerifyResult
VerifyUpdate(
46 syncable::WriteTransaction
* trans
,
47 const sync_pb::SyncEntity
& entry
,
48 ModelTypeSet requested_types
,
49 const ModelSafeRoutingInfo
& routes
);
50 ServerUpdateProcessingResult
ProcessUpdate(
51 const sync_pb::SyncEntity
& proto_update
,
52 const Cryptographer
* cryptographer
,
53 syncable::WriteTransaction
* const trans
);
54 DISALLOW_COPY_AND_ASSIGN(ProcessUpdatesCommand
);
59 #endif // SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_