| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 public: | 100 public: |
| 101 typedef sync_api::UserShare* UserShareHandle; | 101 typedef sync_api::UserShare* UserShareHandle; |
| 102 typedef sync_api::SyncManager::Status::Summary StatusSummary; | 102 typedef sync_api::SyncManager::Status::Summary StatusSummary; |
| 103 typedef sync_api::SyncManager::Status Status; | 103 typedef sync_api::SyncManager::Status Status; |
| 104 typedef std::map<ModelSafeGroup, | 104 typedef std::map<ModelSafeGroup, |
| 105 scoped_refptr<browser_sync::ModelSafeWorker> > WorkerMap; | 105 scoped_refptr<browser_sync::ModelSafeWorker> > WorkerMap; |
| 106 | 106 |
| 107 // Create a SyncBackendHost with a reference to the |frontend| that it serves | 107 // Create a SyncBackendHost with a reference to the |frontend| that it serves |
| 108 // and communicates to via the SyncFrontend interface (on the same thread | 108 // and communicates to via the SyncFrontend interface (on the same thread |
| 109 // it used to call the constructor). | 109 // it used to call the constructor). |
| 110 SyncBackendHost(SyncFrontend* frontend, Profile* profile); | 110 explicit SyncBackendHost(Profile* profile); |
| 111 // For testing. | 111 // For testing. |
| 112 // TODO(skrul): Extract an interface so this is not needed. | 112 // TODO(skrul): Extract an interface so this is not needed. |
| 113 SyncBackendHost(); | 113 SyncBackendHost(); |
| 114 ~SyncBackendHost(); | 114 ~SyncBackendHost(); |
| 115 | 115 |
| 116 // Called on |frontend_loop_| to kick off asynchronous initialization. | 116 // Called on |frontend_loop_| to kick off asynchronous initialization. |
| 117 // As a fallback when no cached auth information is available, try to | 117 // As a fallback when no cached auth information is available, try to |
| 118 // bootstrap authentication using |lsid|, if it isn't empty. | 118 // bootstrap authentication using |lsid|, if it isn't empty. |
| 119 // Optionally delete the Sync Data folder (if it's corrupt). | 119 // Optionally delete the Sync Data folder (if it's corrupt). |
| 120 void Initialize(const GURL& service_url, | 120 void Initialize(SyncFrontend* frontend, |
| 121 const GURL& service_url, |
| 121 const syncable::ModelTypeSet& types, | 122 const syncable::ModelTypeSet& types, |
| 122 URLRequestContextGetter* baseline_context_getter, | 123 URLRequestContextGetter* baseline_context_getter, |
| 123 const sync_api::SyncCredentials& credentials, | 124 const sync_api::SyncCredentials& credentials, |
| 124 bool delete_sync_data_folder, | 125 bool delete_sync_data_folder, |
| 125 const notifier::NotifierOptions& notifier_options); | 126 const notifier::NotifierOptions& notifier_options); |
| 126 | 127 |
| 127 // Called from |frontend_loop| to update SyncCredentials. | 128 // Called from |frontend_loop| to update SyncCredentials. |
| 128 void UpdateCredentials(const sync_api::SyncCredentials& credentials); | 129 void UpdateCredentials(const sync_api::SyncCredentials& credentials); |
| 129 | 130 |
| 130 // This starts the SyncerThread running a Syncer object to communicate with | 131 // This starts the SyncerThread running a Syncer object to communicate with |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 535 |
| 535 // Whether we've processed the initialization complete callback. | 536 // Whether we've processed the initialization complete callback. |
| 536 bool syncapi_initialized_; | 537 bool syncapi_initialized_; |
| 537 | 538 |
| 538 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 539 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 539 }; | 540 }; |
| 540 | 541 |
| 541 } // namespace browser_sync | 542 } // namespace browser_sync |
| 542 | 543 |
| 543 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 544 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |