| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SYNC_ENGINE_DOWNLOAD_H_ | 5 #ifndef SYNC_ENGINE_DOWNLOAD_H_ |
| 6 #define SYNC_ENGINE_DOWNLOAD_H_ | 6 #define SYNC_ENGINE_DOWNLOAD_H_ |
| 7 | 7 |
| 8 #include "sync/base/sync_export.h" | 8 #include "sync/base/sync_export.h" |
| 9 #include "sync/engine/sync_directory_update_handler.h" | 9 #include "sync/engine/updater_list.h" |
| 10 #include "sync/internal_api/public/base/model_type.h" | 10 #include "sync/internal_api/public/base/model_type.h" |
| 11 #include "sync/internal_api/public/util/syncer_error.h" | 11 #include "sync/internal_api/public/util/syncer_error.h" |
| 12 #include "sync/protocol/sync.pb.h" | 12 #include "sync/protocol/sync.pb.h" |
| 13 | 13 |
| 14 namespace sync_pb { | 14 namespace sync_pb { |
| 15 class DebugInfo; | 15 class DebugInfo; |
| 16 } // namespace sync_pb | 16 } // namespace sync_pb |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 | 19 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 SYNC_EXPORT_PRIVATE void BuildNormalDownloadUpdates( | 32 SYNC_EXPORT_PRIVATE void BuildNormalDownloadUpdates( |
| 33 sessions::SyncSession* session, | 33 sessions::SyncSession* session, |
| 34 bool create_mobile_bookmarks_folder, | 34 bool create_mobile_bookmarks_folder, |
| 35 ModelTypeSet request_types, | 35 ModelTypeSet request_types, |
| 36 const sessions::NudgeTracker& nudge_tracker, | 36 const sessions::NudgeTracker& nudge_tracker, |
| 37 sync_pb::ClientToServerMessage* client_to_server_message); | 37 sync_pb::ClientToServerMessage* client_to_server_message); |
| 38 | 38 |
| 39 // Helper function. Defined here for testing. | 39 // Helper function. Defined here for testing. |
| 40 SYNC_EXPORT_PRIVATE void BuildNormalDownloadUpdatesImpl( | 40 SYNC_EXPORT_PRIVATE void BuildNormalDownloadUpdatesImpl( |
| 41 ModelTypeSet proto_request_types, | 41 ModelTypeSet proto_request_types, |
| 42 UpdateHandlerMap* update_handler_map, | 42 UpdaterList* updater_list, |
| 43 const sessions::NudgeTracker& nudge_tracker, | 43 const sessions::NudgeTracker& nudge_tracker, |
| 44 sync_pb::GetUpdatesMessage* get_updates); | 44 sync_pb::GetUpdatesMessage* get_updates); |
| 45 | 45 |
| 46 // This function executes a single GetUpdate request and stores the response in | 46 // This function executes a single GetUpdate request and stores the response in |
| 47 // the session's StatusController. It constructs the type of request used to | 47 // the session's StatusController. It constructs the type of request used to |
| 48 // initialize a type for the first time. | 48 // initialize a type for the first time. |
| 49 SYNC_EXPORT_PRIVATE void BuildDownloadUpdatesForConfigure( | 49 SYNC_EXPORT_PRIVATE void BuildDownloadUpdatesForConfigure( |
| 50 sessions::SyncSession* session, | 50 sessions::SyncSession* session, |
| 51 bool create_mobile_bookmarks_folder, | 51 bool create_mobile_bookmarks_folder, |
| 52 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, | 52 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, |
| 53 ModelTypeSet request_types, | 53 ModelTypeSet request_types, |
| 54 sync_pb::ClientToServerMessage* client_to_server_message); | 54 sync_pb::ClientToServerMessage* client_to_server_message); |
| 55 | 55 |
| 56 // Helper function. Defined here for testing. | 56 // Helper function. Defined here for testing. |
| 57 SYNC_EXPORT_PRIVATE void BuildDownloadUpdatesForConfigureImpl( | 57 SYNC_EXPORT_PRIVATE void BuildDownloadUpdatesForConfigureImpl( |
| 58 ModelTypeSet proto_request_types, | 58 ModelTypeSet proto_request_types, |
| 59 UpdateHandlerMap* update_handler_map, | 59 UpdaterList* updater_list, |
| 60 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, | 60 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, |
| 61 sync_pb::GetUpdatesMessage* get_updates); | 61 sync_pb::GetUpdatesMessage* get_updates); |
| 62 | 62 |
| 63 // This function executes a single GetUpdate request and stores the response in | 63 // This function executes a single GetUpdate request and stores the response in |
| 64 // the session's status controller. It constructs the type of request used for | 64 // the session's status controller. It constructs the type of request used for |
| 65 // periodic polling. | 65 // periodic polling. |
| 66 SYNC_EXPORT_PRIVATE void BuildDownloadUpdatesForPoll( | 66 SYNC_EXPORT_PRIVATE void BuildDownloadUpdatesForPoll( |
| 67 sessions::SyncSession* session, | 67 sessions::SyncSession* session, |
| 68 bool create_mobile_bookmarks_folder, | 68 bool create_mobile_bookmarks_folder, |
| 69 ModelTypeSet request_types, | 69 ModelTypeSet request_types, |
| 70 sync_pb::ClientToServerMessage* client_to_server_message); | 70 sync_pb::ClientToServerMessage* client_to_server_message); |
| 71 | 71 |
| 72 // Helper function. Defined here for testing. | 72 // Helper function. Defined here for testing. |
| 73 SYNC_EXPORT_PRIVATE void BuildDownloadUpdatesForPollImpl( | 73 SYNC_EXPORT_PRIVATE void BuildDownloadUpdatesForPollImpl( |
| 74 ModelTypeSet proto_request_types, | 74 ModelTypeSet proto_request_types, |
| 75 UpdateHandlerMap* update_handler_map, | 75 UpdaterList* updater_list, |
| 76 sync_pb::GetUpdatesMessage* get_updates); | 76 sync_pb::GetUpdatesMessage* get_updates); |
| 77 | 77 |
| 78 // Sends the specified message to the server and stores the response in a member | 78 // Sends the specified message to the server and stores the response in a member |
| 79 // of the |session|'s StatusController. | 79 // of the |session|'s StatusController. |
| 80 SYNC_EXPORT_PRIVATE SyncerError | 80 SYNC_EXPORT_PRIVATE SyncerError |
| 81 ExecuteDownloadUpdates(ModelTypeSet request_types, | 81 ExecuteDownloadUpdates(ModelTypeSet request_types, |
| 82 sessions::SyncSession* session, | 82 sessions::SyncSession* session, |
| 83 sync_pb::ClientToServerMessage* msg); | 83 sync_pb::ClientToServerMessage* msg); |
| 84 | 84 |
| 85 // Helper function for processing responses from the server. | 85 // Helper function for processing responses from the server. |
| 86 // Defined here for testing. | 86 // Defined here for testing. |
| 87 SYNC_EXPORT_PRIVATE SyncerError ProcessResponse( | 87 SYNC_EXPORT_PRIVATE SyncerError ProcessResponse( |
| 88 const sync_pb::GetUpdatesResponse& gu_response, | 88 const sync_pb::GetUpdatesResponse& gu_response, |
| 89 ModelTypeSet proto_request_types, | 89 ModelTypeSet proto_request_types, |
| 90 UpdateHandlerMap* handler_map, | 90 UpdaterList* updater_list, |
| 91 sessions::StatusController* status); | 91 sessions::StatusController* status); |
| 92 | 92 |
| 93 // Helper function to copy client debug info from debug_info_getter to | 93 // Helper function to copy client debug info from debug_info_getter to |
| 94 // debug_info. Defined here for testing. | 94 // debug_info. Defined here for testing. |
| 95 SYNC_EXPORT_PRIVATE void CopyClientDebugInfo( | 95 SYNC_EXPORT_PRIVATE void CopyClientDebugInfo( |
| 96 sessions::DebugInfoGetter* debug_info_getter, | 96 sessions::DebugInfoGetter* debug_info_getter, |
| 97 sync_pb::DebugInfo* debug_info); | 97 sync_pb::DebugInfo* debug_info); |
| 98 | 98 |
| 99 } // namespace download | 99 } // namespace download |
| 100 | 100 |
| 101 } // namespace syncer | 101 } // namespace syncer |
| 102 | 102 |
| 103 #endif // SYNC_ENGINE_DOWNLOAD_H_ | 103 #endif // SYNC_ENGINE_DOWNLOAD_H_ |
| OLD | NEW |