| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 const syncer::SyncCredentials& credentials, | 172 const syncer::SyncCredentials& credentials, |
| 173 bool delete_sync_data_folder, | 173 bool delete_sync_data_folder, |
| 174 syncer::SyncManagerFactory* sync_manager_factory, | 174 syncer::SyncManagerFactory* sync_manager_factory, |
| 175 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, | 175 syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, |
| 176 syncer::ReportUnrecoverableErrorFunction | 176 syncer::ReportUnrecoverableErrorFunction |
| 177 report_unrecoverable_error_function); | 177 report_unrecoverable_error_function); |
| 178 | 178 |
| 179 // Called on |frontend_loop| to update SyncCredentials. | 179 // Called on |frontend_loop| to update SyncCredentials. |
| 180 void UpdateCredentials(const syncer::SyncCredentials& credentials); | 180 void UpdateCredentials(const syncer::SyncCredentials& credentials); |
| 181 | 181 |
| 182 // Registers the underlying frontend for the given IDs to the | 182 // Registers the underlying frontend for the given IDs to the underlying |
| 183 // underlying notifier. | 183 // notifier. This lasts until StopSyncingForShutdown() is called. |
| 184 void UpdateRegisteredInvalidationIds(const syncer::ObjectIdSet& ids); | 184 void UpdateRegisteredInvalidationIds(const syncer::ObjectIdSet& ids); |
| 185 | 185 |
| 186 // This starts the SyncerThread running a Syncer object to communicate with | 186 // This starts the SyncerThread running a Syncer object to communicate with |
| 187 // sync servers. Until this is called, no changes will leave or enter this | 187 // sync servers. Until this is called, no changes will leave or enter this |
| 188 // browser from the cloud / sync servers. | 188 // browser from the cloud / sync servers. |
| 189 // Called on |frontend_loop_|. | 189 // Called on |frontend_loop_|. |
| 190 virtual void StartSyncingWithServer(); | 190 virtual void StartSyncingWithServer(); |
| 191 | 191 |
| 192 // Called on |frontend_loop_| to asynchronously set a new passphrase for | 192 // Called on |frontend_loop_| to asynchronously set a new passphrase for |
| 193 // encryption. Note that it is an error to call SetEncryptionPassphrase under | 193 // encryption. Note that it is an error to call SetEncryptionPassphrase under |
| (...skipping 10 matching lines...) Expand all Loading... |
| 204 | 204 |
| 205 // Called on |frontend_loop_| to use the provided passphrase to asynchronously | 205 // Called on |frontend_loop_| to use the provided passphrase to asynchronously |
| 206 // attempt decryption. Returns false immediately if the passphrase could not | 206 // attempt decryption. Returns false immediately if the passphrase could not |
| 207 // be used to decrypt a locally cached copy of encrypted keys; returns true | 207 // be used to decrypt a locally cached copy of encrypted keys; returns true |
| 208 // otherwise. If new encrypted keys arrive during the asynchronous call, | 208 // otherwise. If new encrypted keys arrive during the asynchronous call, |
| 209 // OnPassphraseRequired may be triggered at a later time. It is an error to | 209 // OnPassphraseRequired may be triggered at a later time. It is an error to |
| 210 // call this when there are no pending keys. | 210 // call this when there are no pending keys. |
| 211 bool SetDecryptionPassphrase(const std::string& passphrase) | 211 bool SetDecryptionPassphrase(const std::string& passphrase) |
| 212 WARN_UNUSED_RESULT; | 212 WARN_UNUSED_RESULT; |
| 213 | 213 |
| 214 // Called on |frontend_loop_| to kick off shutdown procedure. After this, | 214 // Called on |frontend_loop_| to kick off shutdown procedure. After this, no |
| 215 // no further sync activity will occur with the sync server and no further | 215 // further sync activity will occur with the sync server and no further |
| 216 // change applications will occur from changes already downloaded. | 216 // change applications will occur from changes already downloaded. |
| 217 // Furthermore, no notifications will be sent to any invalidation handler. |
| 217 virtual void StopSyncingForShutdown(); | 218 virtual void StopSyncingForShutdown(); |
| 218 | 219 |
| 219 // Called on |frontend_loop_| to kick off shutdown. | 220 // Called on |frontend_loop_| to kick off shutdown. |
| 220 // |sync_disabled| indicates if syncing is being disabled or not. | 221 // |sync_disabled| indicates if syncing is being disabled or not. |
| 221 // See the implementation and Core::DoShutdown for details. | 222 // See the implementation and Core::DoShutdown for details. |
| 222 // Must be called *after* StopSyncingForShutdown. | 223 // Must be called *after* StopSyncingForShutdown. |
| 223 void Shutdown(bool sync_disabled); | 224 void Shutdown(bool sync_disabled); |
| 224 | 225 |
| 225 // Changes the set of data types that are currently being synced. | 226 // Changes the set of data types that are currently being synced. |
| 226 // The ready_task will be run when configuration is done with the | 227 // The ready_task will be run when configuration is done with the |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 | 530 |
| 530 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 531 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
| 531 syncer::sessions::SyncSessionSnapshot last_snapshot_; | 532 syncer::sessions::SyncSessionSnapshot last_snapshot_; |
| 532 | 533 |
| 533 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 534 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 534 }; | 535 }; |
| 535 | 536 |
| 536 } // namespace browser_sync | 537 } // namespace browser_sync |
| 537 | 538 |
| 538 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 539 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |