Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / sync / engine / download.h
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.
4
5 #ifndef SYNC_ENGINE_DOWNLOAD_H_
6 #define SYNC_ENGINE_DOWNLOAD_H_
7
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"
13
14 namespace sync_pb {
15 class DebugInfo;
16 }  // namespace sync_pb
17
18 namespace syncer {
19
20 namespace sessions {
21 class DebugInfoGetter;
22 class StatusController;
23 class SyncSession;
24 }  // namespace sessions
25
26 namespace download {
27
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);
33
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);
41
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);
49
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);
55
56 }  // namespace download
57
58 }  // namespace syncer
59
60 #endif  // SYNC_ENGINE_DOWNLOAD_H_