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.
5 #ifndef SYNC_ENGINE_STORE_TIMESTAMPS_COMMAND_H_
6 #define SYNC_ENGINE_STORE_TIMESTAMPS_COMMAND_H_
8 #include "base/compiler_specific.h"
9 #include "sync/base/sync_export.h"
10 #include "sync/engine/syncer_command.h"
11 #include "sync/engine/syncer_types.h"
12 #include "sync/internal_api/public/base/model_type.h"
15 class GetUpdatesResponse
;
16 } // namespace sync_pb
22 } // namespace syncable
24 // Sets |dir|'s progress markers from the data in |response|. Returns
25 // the set of model types with new progress markers.
26 SYNC_EXPORT_PRIVATE ModelTypeSet
ProcessNewProgressMarkers(
27 const sync_pb::GetUpdatesResponse
& response
,
28 syncable::Directory
* dir
);
30 // A syncer command that extracts the changelog timestamp information from
31 // a GetUpdatesResponse (fetched in DownloadUpdatesCommand) and stores
32 // it in the directory. This is meant to run immediately after
33 // ProcessUpdatesCommand.
35 // Preconditions - all updates in the SyncerSesssion have been stored in the
36 // database, meaning it is safe to update the persisted
39 // Postconditions - The next_timestamp returned by the server will be
40 // saved into the directory (where it will be used
41 // the next time that DownloadUpdatesCommand runs).
42 class StoreTimestampsCommand
: public SyncerCommand
{
44 StoreTimestampsCommand();
45 virtual ~StoreTimestampsCommand();
47 // SyncerCommand implementation.
48 virtual SyncerError
ExecuteImpl(sessions::SyncSession
* session
) OVERRIDE
;
51 DISALLOW_COPY_AND_ASSIGN(StoreTimestampsCommand
);
56 #endif // SYNC_ENGINE_STORE_TIMESTAMPS_COMMAND_H_