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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace base { | 28 namespace base { |
29 class MessageLoop; | 29 class MessageLoop; |
30 } | 30 } |
31 | 31 |
32 namespace syncer { | 32 namespace syncer { |
33 class NetworkResources; | 33 class NetworkResources; |
34 class SyncManagerFactory; | 34 class SyncManagerFactory; |
35 } | 35 } |
36 | 36 |
| 37 namespace sync_driver { |
| 38 class ChangeProcessor; |
| 39 class SyncFrontend; |
| 40 } |
| 41 |
37 namespace browser_sync { | 42 namespace browser_sync { |
38 | 43 |
39 class ChangeProcessor; | |
40 class SyncFrontend; | |
41 class SyncedDeviceTracker; | 44 class SyncedDeviceTracker; |
42 | 45 |
43 // An API to "host" the top level SyncAPI element. | 46 // An API to "host" the top level SyncAPI element. |
44 // | 47 // |
45 // This class handles dispatch of potentially blocking calls to appropriate | 48 // This class handles dispatch of potentially blocking calls to appropriate |
46 // threads and ensures that the SyncFrontend is only accessed on the UI loop. | 49 // threads and ensures that the SyncFrontend is only accessed on the UI loop. |
47 class SyncBackendHost : public BackendDataTypeConfigurer { | 50 class SyncBackendHost : public sync_driver::BackendDataTypeConfigurer { |
48 public: | 51 public: |
49 typedef syncer::SyncStatus Status; | 52 typedef syncer::SyncStatus Status; |
50 | 53 |
51 // Stubs used by implementing classes. | 54 // Stubs used by implementing classes. |
52 SyncBackendHost(); | 55 SyncBackendHost(); |
53 virtual ~SyncBackendHost(); | 56 virtual ~SyncBackendHost(); |
54 | 57 |
55 // Called on the frontend's thread to kick off asynchronous initialization. | 58 // Called on the frontend's thread to kick off asynchronous initialization. |
56 // Optionally deletes the "Sync Data" folder during init in order to make | 59 // Optionally deletes the "Sync Data" folder during init in order to make |
57 // sure we're starting fresh. | 60 // sure we're starting fresh. |
58 // | 61 // |
59 // |report_unrecoverable_error_function| can be NULL. Note: | 62 // |report_unrecoverable_error_function| can be NULL. Note: |
60 // |unrecoverable_error_handler| may be invoked from any thread. | 63 // |unrecoverable_error_handler| may be invoked from any thread. |
61 virtual void Initialize( | 64 virtual void Initialize( |
62 SyncFrontend* frontend, | 65 sync_driver::SyncFrontend* frontend, |
63 scoped_ptr<base::Thread> sync_thread, | 66 scoped_ptr<base::Thread> sync_thread, |
64 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 67 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
65 const GURL& service_url, | 68 const GURL& service_url, |
66 const syncer::SyncCredentials& credentials, | 69 const syncer::SyncCredentials& credentials, |
67 bool delete_sync_data_folder, | 70 bool delete_sync_data_folder, |
68 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, | 71 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
69 scoped_ptr<syncer::UnrecoverableErrorHandler> unrecoverable_error_handler, | 72 scoped_ptr<syncer::UnrecoverableErrorHandler> unrecoverable_error_handler, |
70 syncer::ReportUnrecoverableErrorFunction | 73 syncer::ReportUnrecoverableErrorFunction |
71 report_unrecoverable_error_function, | 74 report_unrecoverable_error_function, |
72 syncer::NetworkResources* network_resources) = 0; | 75 syncer::NetworkResources* network_resources) = 0; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 virtual void DisableDirectoryTypeDebugInfoForwarding() = 0; | 216 virtual void DisableDirectoryTypeDebugInfoForwarding() = 0; |
214 | 217 |
215 virtual base::MessageLoop* GetSyncLoopForTesting() = 0; | 218 virtual base::MessageLoop* GetSyncLoopForTesting() = 0; |
216 | 219 |
217 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 220 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
218 }; | 221 }; |
219 | 222 |
220 } // namespace browser_sync | 223 } // namespace browser_sync |
221 | 224 |
222 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 225 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |