| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 183 // underlying notifier. | 183 // underlying notifier. This lasts until StopSyncingForShutdown() |
| 184 // is called. |
| 184 void UpdateRegisteredInvalidationIds(const syncer::ObjectIdSet& ids); | 185 void UpdateRegisteredInvalidationIds(const syncer::ObjectIdSet& ids); |
| 185 | 186 |
| 186 // This starts the SyncerThread running a Syncer object to communicate with | 187 // 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 | 188 // sync servers. Until this is called, no changes will leave or enter this |
| 188 // browser from the cloud / sync servers. | 189 // browser from the cloud / sync servers. |
| 189 // Called on |frontend_loop_|. | 190 // Called on |frontend_loop_|. |
| 190 virtual void StartSyncingWithServer(); | 191 virtual void StartSyncingWithServer(); |
| 191 | 192 |
| 192 // Called on |frontend_loop_| to asynchronously set a new passphrase for | 193 // Called on |frontend_loop_| to asynchronously set a new passphrase for |
| 193 // encryption. Note that it is an error to call SetEncryptionPassphrase under | 194 // encryption. Note that it is an error to call SetEncryptionPassphrase under |
| (...skipping 10 matching lines...) Expand all Loading... |
| 204 | 205 |
| 205 // Called on |frontend_loop_| to use the provided passphrase to asynchronously | 206 // Called on |frontend_loop_| to use the provided passphrase to asynchronously |
| 206 // attempt decryption. Returns false immediately if the passphrase could not | 207 // attempt decryption. Returns false immediately if the passphrase could not |
| 207 // be used to decrypt a locally cached copy of encrypted keys; returns true | 208 // be used to decrypt a locally cached copy of encrypted keys; returns true |
| 208 // otherwise. If new encrypted keys arrive during the asynchronous call, | 209 // otherwise. If new encrypted keys arrive during the asynchronous call, |
| 209 // OnPassphraseRequired may be triggered at a later time. It is an error to | 210 // OnPassphraseRequired may be triggered at a later time. It is an error to |
| 210 // call this when there are no pending keys. | 211 // call this when there are no pending keys. |
| 211 bool SetDecryptionPassphrase(const std::string& passphrase) | 212 bool SetDecryptionPassphrase(const std::string& passphrase) |
| 212 WARN_UNUSED_RESULT; | 213 WARN_UNUSED_RESULT; |
| 213 | 214 |
| 214 // Called on |frontend_loop_| to kick off shutdown procedure. After this, | 215 // Called on |frontend_loop_| to kick off shutdown procedure. After |
| 215 // no further sync activity will occur with the sync server and no further | 216 // this, no further sync activity will occur with the sync server |
| 216 // change applications will occur from changes already downloaded. | 217 // and no further change applications will occur from changes |
| 218 // already downloaded. Furthermore, no notifications are sent to |
| 219 // any invalidation handler. |
| 217 virtual void StopSyncingForShutdown(); | 220 virtual void StopSyncingForShutdown(); |
| 218 | 221 |
| 219 // Called on |frontend_loop_| to kick off shutdown. | 222 // Called on |frontend_loop_| to kick off shutdown. |
| 220 // |sync_disabled| indicates if syncing is being disabled or not. | 223 // |sync_disabled| indicates if syncing is being disabled or not. |
| 221 // See the implementation and Core::DoShutdown for details. | 224 // See the implementation and Core::DoShutdown for details. |
| 222 // Must be called *after* StopSyncingForShutdown. | 225 // Must be called *after* StopSyncingForShutdown. |
| 223 void Shutdown(bool sync_disabled); | 226 void Shutdown(bool sync_disabled); |
| 224 | 227 |
| 225 // Changes the set of data types that are currently being synced. | 228 // Changes the set of data types that are currently being synced. |
| 226 // The ready_task will be run when configuration is done with the | 229 // The ready_task will be run when configuration is done with the |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 // give the user immediate feedback about the passphrase entered by first | 526 // give the user immediate feedback about the passphrase entered by first |
| 524 // trying to decrypt the cached pending keys on the UI thread. Note that | 527 // trying to decrypt the cached pending keys on the UI thread. Note that |
| 525 // SetDecryptionPassphrase can still fail after the cached pending keys are | 528 // SetDecryptionPassphrase can still fail after the cached pending keys are |
| 526 // successfully decrypted if the pending keys have changed since the time they | 529 // successfully decrypted if the pending keys have changed since the time they |
| 527 // were cached. | 530 // were cached. |
| 528 sync_pb::EncryptedData cached_pending_keys_; | 531 sync_pb::EncryptedData cached_pending_keys_; |
| 529 | 532 |
| 530 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 533 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
| 531 syncer::sessions::SyncSessionSnapshot last_snapshot_; | 534 syncer::sessions::SyncSessionSnapshot last_snapshot_; |
| 532 | 535 |
| 536 // Whether or not we propagate notifications to invalidation |
| 537 // handlers. |
| 538 bool propagate_invalidations_; |
| 539 |
| 533 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 540 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 534 }; | 541 }; |
| 535 | 542 |
| 536 } // namespace browser_sync | 543 } // namespace browser_sync |
| 537 | 544 |
| 538 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 545 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |