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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 ChangeProcessor* change_processor) = 0; | 152 ChangeProcessor* change_processor) = 0; |
152 | 153 |
153 // Deactivates change processing for the given data type. | 154 // Deactivates change processing for the given data type. |
154 virtual void DeactivateDataType(syncer::ModelType type) = 0; | 155 virtual void DeactivateDataType(syncer::ModelType type) = 0; |
155 | 156 |
156 // Called on |frontend_loop_| to obtain a handle to the UserShare needed for | 157 // Called on |frontend_loop_| to obtain a handle to the UserShare needed for |
157 // creating transactions. Should not be called before we signal | 158 // creating transactions. Should not be called before we signal |
158 // initialization is complete with OnBackendInitialized(). | 159 // initialization is complete with OnBackendInitialized(). |
159 virtual syncer::UserShare* GetUserShare() const = 0; | 160 virtual syncer::UserShare* GetUserShare() const = 0; |
160 | 161 |
| 162 // Called on |frontend_loop_| to obtain a handle to the SyncCore needed by |
| 163 // the non-blocking sync types to communicate with the server. |
| 164 virtual syncer::SyncCoreProxy GetSyncCoreProxy() = 0; |
| 165 |
161 // Called from any thread to obtain current status information in detailed or | 166 // Called from any thread to obtain current status information in detailed or |
162 // summarized form. | 167 // summarized form. |
163 virtual Status GetDetailedStatus() = 0; | 168 virtual Status GetDetailedStatus() = 0; |
164 virtual syncer::sessions::SyncSessionSnapshot | 169 virtual syncer::sessions::SyncSessionSnapshot |
165 GetLastSessionSnapshot() const = 0; | 170 GetLastSessionSnapshot() const = 0; |
166 | 171 |
167 // Determines if the underlying sync engine has made any local changes to | 172 // Determines if the underlying sync engine has made any local changes to |
168 // items that have not yet been synced with the server. | 173 // items that have not yet been synced with the server. |
169 // ONLY CALL THIS IF OnInitializationComplete was called! | 174 // ONLY CALL THIS IF OnInitializationComplete was called! |
170 virtual bool HasUnsyncedItems() const = 0; | 175 virtual bool HasUnsyncedItems() const = 0; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 virtual void DisableProtocolEventForwarding() = 0; | 207 virtual void DisableProtocolEventForwarding() = 0; |
203 | 208 |
204 virtual base::MessageLoop* GetSyncLoopForTesting() = 0; | 209 virtual base::MessageLoop* GetSyncLoopForTesting() = 0; |
205 | 210 |
206 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 211 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
207 }; | 212 }; |
208 | 213 |
209 } // namespace browser_sync | 214 } // namespace browser_sync |
210 | 215 |
211 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 216 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |