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/engine/get_updates_processor.h"
10 #include "sync/internal_api/public/base/model_type.h"
11 #include "sync/internal_api/public/util/syncer_error.h"
12 #include "sync/protocol/sync.pb.h"
16 } // namespace sync_pb
21 class DebugInfoGetter;
22 class StatusController;
24 } // namespace sessions
28 // Generic initialization of a GetUpdates message.
29 SYNC_EXPORT_PRIVATE void InitDownloadUpdatesContext(
30 sessions::SyncSession* session,
31 bool create_mobile_bookmarks_folder,
32 sync_pb::ClientToServerMessage* message);
34 // Sends the specified message to the server and stores the response in a member
35 // of the |session|'s StatusController.
36 SYNC_EXPORT_PRIVATE SyncerError
37 ExecuteDownloadUpdates(ModelTypeSet request_types,
38 sessions::SyncSession* session,
39 GetUpdatesProcessor* get_updates_processor,
40 sync_pb::ClientToServerMessage* msg);
42 // Helper function for processing responses from the server.
43 // Defined here for testing.
44 SYNC_EXPORT_PRIVATE SyncerError ProcessResponse(
45 const sync_pb::GetUpdatesResponse& gu_response,
46 ModelTypeSet proto_request_types,
47 GetUpdatesProcessor* get_updates_processor,
48 sessions::StatusController* status);
50 // Helper function to copy client debug info from debug_info_getter to
51 // debug_info. Defined here for testing.
52 SYNC_EXPORT_PRIVATE void CopyClientDebugInfo(
53 sessions::DebugInfoGetter* debug_info_getter,
54 sync_pb::DebugInfo* debug_info);
56 } // namespace download
60 #endif // SYNC_ENGINE_DOWNLOAD_H_