| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // update on behalf of SyncBackendHost::UpdateCredentials | 337 // update on behalf of SyncBackendHost::UpdateCredentials |
| 338 void DoUpdateCredentials(const sync_api::SyncCredentials& credentials); | 338 void DoUpdateCredentials(const sync_api::SyncCredentials& credentials); |
| 339 | 339 |
| 340 // Called when the user disables or enables a sync type. | 340 // Called when the user disables or enables a sync type. |
| 341 void DoUpdateEnabledTypes(); | 341 void DoUpdateEnabledTypes(); |
| 342 | 342 |
| 343 // Called on the SyncBackendHost sync_thread_ to tell the syncapi to start | 343 // Called on the SyncBackendHost sync_thread_ to tell the syncapi to start |
| 344 // syncing (generally after initialization and authentication). | 344 // syncing (generally after initialization and authentication). |
| 345 void DoStartSyncing(); | 345 void DoStartSyncing(); |
| 346 | 346 |
| 347 // Called on the SyncBackendHost sync_thread_ to nudge/pause/resume the | 347 // Called on the SyncBackendHost sync_thread_ to clear server |
| 348 // syncer. | 348 // data. |
| 349 void DoRequestNudge(const tracked_objects::Location& location); | |
| 350 void DoRequestClearServerData(); | 349 void DoRequestClearServerData(); |
| 351 | 350 |
| 352 // Sets |deferred_nudge_for_cleanup_requested_| to true. See comment below. | 351 // Sets |deferred_cleanup_requested_| to true. See comment below. |
| 353 void DeferNudgeForCleanup(); | 352 void DeferCleanup(); |
| 354 | 353 |
| 355 // Called on our SyncBackendHost's |sync_thread_| to set the passphrase | 354 // Called on our SyncBackendHost's |sync_thread_| to set the passphrase |
| 356 // on behalf of SyncBackendHost::SupplyPassphrase. | 355 // on behalf of SyncBackendHost::SupplyPassphrase. |
| 357 void DoSetPassphrase(const std::string& passphrase, bool is_explicit); | 356 void DoSetPassphrase(const std::string& passphrase, bool is_explicit); |
| 358 | 357 |
| 359 // Getter/setter for whether we are waiting on SetPassphrase to process a | 358 // Getter/setter for whether we are waiting on SetPassphrase to process a |
| 360 // passphrase. Set by SetPassphrase, cleared by OnPassphraseRequired or | 359 // passphrase. Set by SetPassphrase, cleared by OnPassphraseRequired or |
| 361 // OnPassphraseAccepted. | 360 // OnPassphraseAccepted. |
| 362 bool processing_passphrase() const; | 361 bool processing_passphrase() const; |
| 363 void set_processing_passphrase(); | 362 void set_processing_passphrase(); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 JsEventRouter* parent_router_; | 511 JsEventRouter* parent_router_; |
| 513 | 512 |
| 514 // Denotes if the core is currently attempting to set a passphrase. While | 513 // Denotes if the core is currently attempting to set a passphrase. While |
| 515 // this is true, OnPassphraseRequired calls are dropped. | 514 // this is true, OnPassphraseRequired calls are dropped. |
| 516 // Note: after initialization, this variable should only ever be accessed or | 515 // Note: after initialization, this variable should only ever be accessed or |
| 517 // modified from within the frontend_loop_ (UI thread). | 516 // modified from within the frontend_loop_ (UI thread). |
| 518 bool processing_passphrase_; | 517 bool processing_passphrase_; |
| 519 | 518 |
| 520 // True when a datatype has been disabled so that we nudge once sync is | 519 // True when a datatype has been disabled so that we nudge once sync is |
| 521 // resumed (after configuration is finished). | 520 // resumed (after configuration is finished). |
| 522 bool deferred_nudge_for_cleanup_requested_; | 521 // TODO(akalin): Remove the need for this. |
| 522 bool deferred_cleanup_requested_; |
| 523 | 523 |
| 524 DISALLOW_COPY_AND_ASSIGN(Core); | 524 DISALLOW_COPY_AND_ASSIGN(Core); |
| 525 }; | 525 }; |
| 526 | 526 |
| 527 // InitializationComplete passes through the SyncBackendHost to forward | 527 // InitializationComplete passes through the SyncBackendHost to forward |
| 528 // on to |frontend_|, and so that tests can intercept here if they need to | 528 // on to |frontend_|, and so that tests can intercept here if they need to |
| 529 // set up initial conditions. | 529 // set up initial conditions. |
| 530 virtual void HandleInitializationCompletedOnFrontendLoop(bool success); | 530 virtual void HandleInitializationCompletedOnFrontendLoop(bool success); |
| 531 | 531 |
| 532 // Posts a nudge request on the sync thread. | |
| 533 virtual void RequestNudge(const tracked_objects::Location& location); | |
| 534 | |
| 535 // Called to finish the job of ConfigureDataTypes once the syncer is in | 532 // Called to finish the job of ConfigureDataTypes once the syncer is in |
| 536 // configuration mode. | 533 // configuration mode. |
| 537 void FinishConfigureDataTypes(); | 534 void FinishConfigureDataTypes(); |
| 538 void FinishConfigureDataTypesOnFrontendLoop(); | 535 void FinishConfigureDataTypesOnFrontendLoop(); |
| 539 | 536 |
| 540 // Allows tests to perform alternate core initialization work. | 537 // Allows tests to perform alternate core initialization work. |
| 541 virtual void InitCore(const Core::DoInitializeOptions& options); | 538 virtual void InitCore(const Core::DoInitializeOptions& options); |
| 542 | 539 |
| 543 // Factory method for HttpPostProviderFactories. Should be | 540 // Factory method for HttpPostProviderFactories. Should be |
| 544 // thread-safe. | 541 // thread-safe. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 | 646 |
| 650 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 647 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
| 651 scoped_ptr<sessions::SyncSessionSnapshot> last_snapshot_; | 648 scoped_ptr<sessions::SyncSessionSnapshot> last_snapshot_; |
| 652 | 649 |
| 653 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 650 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 654 }; | 651 }; |
| 655 | 652 |
| 656 } // namespace browser_sync | 653 } // namespace browser_sync |
| 657 | 654 |
| 658 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 655 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |