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/internal_api/public/base/model_type.h" 10 #include "sync/internal_api/public/util/syncer_error.h" 11 #include "sync/protocol/sync.pb.h" 12 13 namespace sync_pb { 14 class DebugInfo; 15 } // namespace sync_pb 16 17 namespace syncer { 18 19 namespace sessions { 20 class NudgeTracker; 21 class SyncSession; 22 } // namespace sessions 23 24 class Syncer; 25 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 SyncerError NormalDownloadUpdates( 30 sessions::SyncSession* session, 31 bool create_mobile_bookmarks_folder, 32 ModelTypeSet request_types, 33 const sessions::NudgeTracker& nudge_tracker); 34 35 // This function executes a single GetUpdate request and stores the response in 36 // the session's StatusController. It constructs the type of request used to 37 // initialize a type for the first time. 38 SYNC_EXPORT_PRIVATE SyncerError DownloadUpdatesForConfigure( 39 sessions::SyncSession* session, 40 bool create_mobile_bookmarks_folder, 41 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, 42 ModelTypeSet request_types); 43 44 // This function executes a single GetUpdate request and stores the response in 45 // the session's status controller. It constructs the type of request used for 46 // periodic polling. 47 SYNC_EXPORT_PRIVATE SyncerError DownloadUpdatesForPoll( 48 sessions::SyncSession* session, 49 bool create_mobile_bookmarks_folder, 50 ModelTypeSet request_types); 51 52 // A helper to set debug info. Exposed only for testing. 53 SYNC_EXPORT_PRIVATE void AppendClientDebugInfoIfNeeded( 54 sessions::SyncSession* session, 55 sync_pb::DebugInfo* debug_info); 56 57 } // namespace syncer 58 59 #endif // SYNC_ENGINE_DOWNLOAD_H_ 60