OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
15 #include "components/sync_driver/backend_data_type_configurer.h" | 15 #include "components/sync_driver/backend_data_type_configurer.h" |
16 #include "sync/internal_api/public/base/model_type.h" | 16 #include "sync/internal_api/public/base/model_type.h" |
17 #include "sync/internal_api/public/configure_reason.h" | 17 #include "sync/internal_api/public/configure_reason.h" |
18 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" | 18 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
| 19 #include "sync/internal_api/public/sync_core_proxy.h" |
19 #include "sync/internal_api/public/sync_manager.h" | 20 #include "sync/internal_api/public/sync_manager.h" |
20 #include "sync/internal_api/public/sync_manager_factory.h" | 21 #include "sync/internal_api/public/sync_manager_factory.h" |
21 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" | 22 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" |
22 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 23 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
23 #include "sync/internal_api/public/util/weak_handle.h" | 24 #include "sync/internal_api/public/util/weak_handle.h" |
24 | 25 |
25 class GURL; | 26 class GURL; |
26 | 27 |
27 namespace base { | 28 namespace base { |
28 class MessageLoop; | 29 class MessageLoop; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 STOP, // Stop syncing and let backend stop sync thread. | 122 STOP, // Stop syncing and let backend stop sync thread. |
122 STOP_AND_CLAIM_THREAD, // Stop syncing and return sync thread. | 123 STOP_AND_CLAIM_THREAD, // Stop syncing and return sync thread. |
123 DISABLE_AND_CLAIM_THREAD, // Disable sync and return sync thread. | 124 DISABLE_AND_CLAIM_THREAD, // Disable sync and return sync thread. |
124 }; | 125 }; |
125 virtual scoped_ptr<base::Thread> Shutdown(ShutdownOption option) = 0; | 126 virtual scoped_ptr<base::Thread> Shutdown(ShutdownOption option) = 0; |
126 | 127 |
127 // Removes all current registrations from the backend on the | 128 // Removes all current registrations from the backend on the |
128 // InvalidationService. | 129 // InvalidationService. |
129 virtual void UnregisterInvalidationIds() = 0; | 130 virtual void UnregisterInvalidationIds() = 0; |
130 | 131 |
| 132 // Specifies the set of user-preferred non-blocking data types. |
| 133 virtual void SetPreferredNonBlockingTypes(syncer::ModelTypeSet types) = 0; |
| 134 |
131 // Changes the set of data types that are currently being synced. | 135 // Changes the set of data types that are currently being synced. |
132 // The ready_task will be run when configuration is done with the | 136 // The ready_task will be run when configuration is done with the |
133 // set of all types that failed configuration (i.e., if its argument | 137 // set of all types that failed configuration (i.e., if its argument |
134 // is non-empty, then an error was encountered). | 138 // is non-empty, then an error was encountered). |
135 virtual void ConfigureDataTypes( | 139 virtual void ConfigureDataTypes( |
136 syncer::ConfigureReason reason, | 140 syncer::ConfigureReason reason, |
137 const DataTypeConfigStateMap& config_state_map, | 141 const DataTypeConfigStateMap& config_state_map, |
138 const base::Callback<void(syncer::ModelTypeSet, | 142 const base::Callback<void(syncer::ModelTypeSet, |
139 syncer::ModelTypeSet)>& ready_task, | 143 syncer::ModelTypeSet)>& ready_task, |
140 const base::Callback<void()>& retry_callback) OVERRIDE = 0; | 144 const base::Callback<void()>& retry_callback) OVERRIDE = 0; |
(...skipping 10 matching lines...) Expand all Loading... |
151 ChangeProcessor* change_processor) = 0; | 155 ChangeProcessor* change_processor) = 0; |
152 | 156 |
153 // Deactivates change processing for the given data type. | 157 // Deactivates change processing for the given data type. |
154 virtual void DeactivateDataType(syncer::ModelType type) = 0; | 158 virtual void DeactivateDataType(syncer::ModelType type) = 0; |
155 | 159 |
156 // Called on |frontend_loop_| to obtain a handle to the UserShare needed for | 160 // Called on |frontend_loop_| to obtain a handle to the UserShare needed for |
157 // creating transactions. Should not be called before we signal | 161 // creating transactions. Should not be called before we signal |
158 // initialization is complete with OnBackendInitialized(). | 162 // initialization is complete with OnBackendInitialized(). |
159 virtual syncer::UserShare* GetUserShare() const = 0; | 163 virtual syncer::UserShare* GetUserShare() const = 0; |
160 | 164 |
| 165 // Called on |frontend_loop_| to obtain a handle to the SyncCore needed by |
| 166 // the non-blocking sync types to communicate with the server. |
| 167 virtual syncer::SyncCoreProxy GetSyncCoreProxy() = 0; |
| 168 |
161 // Called from any thread to obtain current status information in detailed or | 169 // Called from any thread to obtain current status information in detailed or |
162 // summarized form. | 170 // summarized form. |
163 virtual Status GetDetailedStatus() = 0; | 171 virtual Status GetDetailedStatus() = 0; |
164 virtual syncer::sessions::SyncSessionSnapshot | 172 virtual syncer::sessions::SyncSessionSnapshot |
165 GetLastSessionSnapshot() const = 0; | 173 GetLastSessionSnapshot() const = 0; |
166 | 174 |
167 // Determines if the underlying sync engine has made any local changes to | 175 // Determines if the underlying sync engine has made any local changes to |
168 // items that have not yet been synced with the server. | 176 // items that have not yet been synced with the server. |
169 // ONLY CALL THIS IF OnInitializationComplete was called! | 177 // ONLY CALL THIS IF OnInitializationComplete was called! |
170 virtual bool HasUnsyncedItems() const = 0; | 178 virtual bool HasUnsyncedItems() const = 0; |
(...skipping 25 matching lines...) Expand all Loading... |
196 virtual void SetForwardProtocolEvents(bool forward) = 0; | 204 virtual void SetForwardProtocolEvents(bool forward) = 0; |
197 | 205 |
198 virtual base::MessageLoop* GetSyncLoopForTesting() = 0; | 206 virtual base::MessageLoop* GetSyncLoopForTesting() = 0; |
199 | 207 |
200 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 208 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
201 }; | 209 }; |
202 | 210 |
203 } // namespace browser_sync | 211 } // namespace browser_sync |
204 | 212 |
205 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 213 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |