| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 // Called on the SyncBackendHost sync_thread_ to tell the syncapi to start | 354 // Called on the SyncBackendHost sync_thread_ to tell the syncapi to start |
| 355 // syncing (generally after initialization and authentication). | 355 // syncing (generally after initialization and authentication). |
| 356 void DoStartSyncing(); | 356 void DoStartSyncing(); |
| 357 | 357 |
| 358 // Called on the SyncBackendHost sync_thread_ to nudge/pause/resume the | 358 // Called on the SyncBackendHost sync_thread_ to nudge/pause/resume the |
| 359 // syncer. | 359 // syncer. |
| 360 void DoRequestNudge(const tracked_objects::Location& location); | 360 void DoRequestNudge(const tracked_objects::Location& location); |
| 361 void DoRequestClearServerData(); | 361 void DoRequestClearServerData(); |
| 362 | 362 |
| 363 // Sets |deferred_nudge_for_cleanup_requested_| to true. See comment below. | |
| 364 void DeferNudgeForCleanup(); | |
| 365 | |
| 366 // Called on our SyncBackendHost's |sync_thread_| to set the passphrase | 363 // Called on our SyncBackendHost's |sync_thread_| to set the passphrase |
| 367 // on behalf of SyncBackendHost::SupplyPassphrase. | 364 // on behalf of SyncBackendHost::SupplyPassphrase. |
| 368 void DoSetPassphrase(const std::string& passphrase, bool is_explicit); | 365 void DoSetPassphrase(const std::string& passphrase, bool is_explicit); |
| 369 | 366 |
| 370 // Getter/setter for whether we are waiting on SetPassphrase to process a | 367 // Getter/setter for whether we are waiting on SetPassphrase to process a |
| 371 // passphrase. Set by SetPassphrase, cleared by OnPassphraseRequired or | 368 // passphrase. Set by SetPassphrase, cleared by OnPassphraseRequired or |
| 372 // OnPassphraseAccepted. | 369 // OnPassphraseAccepted. |
| 373 bool processing_passphrase() const; | 370 bool processing_passphrase() const; |
| 374 void set_processing_passphrase(); | 371 void set_processing_passphrase(); |
| 375 | 372 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 JsSyncManagerObserver sync_manager_observer_; | 518 JsSyncManagerObserver sync_manager_observer_; |
| 522 | 519 |
| 523 JsEventRouter* parent_router_; | 520 JsEventRouter* parent_router_; |
| 524 | 521 |
| 525 // Denotes if the core is currently attempting to set a passphrase. While | 522 // Denotes if the core is currently attempting to set a passphrase. While |
| 526 // this is true, OnPassphraseRequired calls are dropped. | 523 // this is true, OnPassphraseRequired calls are dropped. |
| 527 // Note: after initialization, this variable should only ever be accessed or | 524 // Note: after initialization, this variable should only ever be accessed or |
| 528 // modified from within the frontend_loop_ (UI thread). | 525 // modified from within the frontend_loop_ (UI thread). |
| 529 bool processing_passphrase_; | 526 bool processing_passphrase_; |
| 530 | 527 |
| 531 // True when a datatype has been disabled so that we nudge once sync is | |
| 532 // resumed (after configuration is finished). | |
| 533 bool deferred_nudge_for_cleanup_requested_; | |
| 534 | |
| 535 DISALLOW_COPY_AND_ASSIGN(Core); | 528 DISALLOW_COPY_AND_ASSIGN(Core); |
| 536 }; | 529 }; |
| 537 | 530 |
| 538 // InitializationComplete passes through the SyncBackendHost to forward | 531 // InitializationComplete passes through the SyncBackendHost to forward |
| 539 // on to |frontend_|, and so that tests can intercept here if they need to | 532 // on to |frontend_|, and so that tests can intercept here if they need to |
| 540 // set up initial conditions. | 533 // set up initial conditions. |
| 541 virtual void HandleInitializationCompletedOnFrontendLoop(); | 534 virtual void HandleInitializationCompletedOnFrontendLoop(); |
| 542 | 535 |
| 543 // Posts a nudge request on the sync thread. | 536 // Posts a nudge request on the sync thread. |
| 544 virtual void RequestNudge(const tracked_objects::Location& location); | 537 virtual void RequestNudge(const tracked_objects::Location& location); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 | 572 |
| 580 // A task that should be called once data type configuration is | 573 // A task that should be called once data type configuration is |
| 581 // complete. | 574 // complete. |
| 582 scoped_ptr<CancelableTask> ready_task; | 575 scoped_ptr<CancelableTask> ready_task; |
| 583 | 576 |
| 584 // The set of types that we are waiting to be initially synced in a | 577 // The set of types that we are waiting to be initially synced in a |
| 585 // configuration cycle. | 578 // configuration cycle. |
| 586 syncable::ModelTypeSet initial_types; | 579 syncable::ModelTypeSet initial_types; |
| 587 | 580 |
| 588 // Additional details about which types were added / removed. | 581 // Additional details about which types were added / removed. |
| 589 bool deleted_type; | |
| 590 syncable::ModelTypeBitSet added_types; | 582 syncable::ModelTypeBitSet added_types; |
| 591 sync_api::ConfigureReason reason; | 583 sync_api::ConfigureReason reason; |
| 592 }; | 584 }; |
| 593 | 585 |
| 594 UIModelWorker* ui_worker(); | 586 UIModelWorker* ui_worker(); |
| 595 | 587 |
| 596 void ConfigureAutofillMigration(); | 588 void ConfigureAutofillMigration(); |
| 597 | 589 |
| 598 // Helper function for ConfigureDataTypes(). Caller owns return | 590 // Helper function for ConfigureDataTypes(). Caller owns return |
| 599 // value. Takes ownership of |ready_task| (but not |routing_info|). | 591 // value. Takes ownership of |ready_task| (but not |routing_info|). |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 | 654 |
| 663 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 655 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
| 664 scoped_ptr<sessions::SyncSessionSnapshot> last_snapshot_; | 656 scoped_ptr<sessions::SyncSessionSnapshot> last_snapshot_; |
| 665 | 657 |
| 666 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 658 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 667 }; | 659 }; |
| 668 | 660 |
| 669 } // namespace browser_sync | 661 } // namespace browser_sync |
| 670 | 662 |
| 671 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 663 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |