1 // Copyright 2013 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_DOWNLOAD_H_
6 #define SYNC_ENGINE_DOWNLOAD_H_
8 #include "sync/base/sync_export.h"
9 #include "sync/internal_api/public/base/model_type.h"
10 #include "sync/internal_api/public/util/syncer_error.h"
11 #include "sync/protocol/sync.pb.h"
15 } // namespace sync_pb
22 } // namespace sessions
26 // This function executes a single GetUpdate request and stores the response in
27 // the session's StatusController. It constructs the type of request used to
28 // keep types in sync when in normal mode.
29 SYNC_EXPORT_PRIVATE
void BuildNormalDownloadUpdates(
30 sessions::SyncSession
* session
,
31 bool create_mobile_bookmarks_folder
,
32 ModelTypeSet request_types
,
33 const sessions::NudgeTracker
& nudge_tracker
,
34 sync_pb::ClientToServerMessage
* client_to_server_message
);
36 // This function executes a single GetUpdate request and stores the response in
37 // the session's StatusController. It constructs the type of request used to
38 // initialize a type for the first time.
39 SYNC_EXPORT_PRIVATE
void BuildDownloadUpdatesForConfigure(
40 sessions::SyncSession
* session
,
41 bool create_mobile_bookmarks_folder
,
42 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source
,
43 ModelTypeSet request_types
,
44 sync_pb::ClientToServerMessage
* client_to_server_message
);
46 // This function executes a single GetUpdate request and stores the response in
47 // the session's status controller. It constructs the type of request used for
49 SYNC_EXPORT_PRIVATE
void BuildDownloadUpdatesForPoll(
50 sessions::SyncSession
* session
,
51 bool create_mobile_bookmarks_folder
,
52 ModelTypeSet request_types
,
53 sync_pb::ClientToServerMessage
* client_to_server_message
);
55 // Sends the specified message to the server and stores the response in a member
56 // of the |session|'s StatusController.
57 SYNC_EXPORT_PRIVATE SyncerError
58 ExecuteDownloadUpdates(ModelTypeSet request_types
,
59 sessions::SyncSession
* session
,
60 sync_pb::ClientToServerMessage
* msg
);
64 #endif // SYNC_ENGINE_DOWNLOAD_H_