Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(634)

Side by Side Diff: sync/internal_api/sync_manager.h

Issue 10483015: [Sync] Refactor sync configuration logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 SYNC_INTERNAL_API_SYNC_MANAGER_H_ 5 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_H_
6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 // re-encryption once the pending keys are decrypted. 490 // re-encryption once the pending keys are decrypted.
491 void SetEncryptionPassphrase(const std::string& passphrase, bool is_explicit); 491 void SetEncryptionPassphrase(const std::string& passphrase, bool is_explicit);
492 492
493 // Provides a passphrase for decrypting the user's existing sync data. 493 // Provides a passphrase for decrypting the user's existing sync data.
494 // Notifies observers of the result of the operation via OnPassphraseAccepted 494 // Notifies observers of the result of the operation via OnPassphraseAccepted
495 // or OnPassphraseRequired, updates the nigori node, and does re-encryption as 495 // or OnPassphraseRequired, updates the nigori node, and does re-encryption as
496 // appropriate if there is a previously cached encryption passphrase. It is an 496 // appropriate if there is a previously cached encryption passphrase. It is an
497 // error to call this when we don't have pending keys. 497 // error to call this when we don't have pending keys.
498 void SetDecryptionPassphrase(const std::string& passphrase); 498 void SetDecryptionPassphrase(const std::string& passphrase);
499 499
500 // Puts the SyncScheduler into a mode where no normal nudge or poll traffic
501 // will occur, but calls to RequestConfig will be supported. If |callback|
502 // is provided, it will be invoked (from the internal SyncScheduler) when
503 // the thread has changed to configuration mode.
504 void StartConfigurationMode(const base::Closure& callback);
505
506 // Switches the mode of operation to CONFIGURATION_MODE and
507 // schedules a config task to fetch updates for |types|.
508 void RequestConfig(const browser_sync::ModelSafeRoutingInfo& routing_info,
509 const syncable::ModelTypeSet& types,
510 sync_api::ConfigureReason reason);
511
512 void RequestCleanupDisabledTypes(
513 const browser_sync::ModelSafeRoutingInfo& routing_info);
514
515 // Request a clearing of all data on the server 500 // Request a clearing of all data on the server
516 void RequestClearServerData(); 501 void RequestClearServerData();
517 502
503 // Switches the mode of operation to CONFIGURATION_MODE and performs
504 // any configuration tasks needed as determined by the params. Once complete,
505 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is
506 // called.
507 void ConfigureSyncer(
508 ConfigureReason reason,
509 const syncable::ModelTypeSet& types_to_config,
510 const browser_sync::ModelSafeRoutingInfo& new_routing_info,
511 const base::Closure& ready_task,
512 const base::Closure& retry_task);
513
518 // Adds a listener to be notified of sync events. 514 // Adds a listener to be notified of sync events.
519 // NOTE: It is OK (in fact, it's probably a good idea) to call this before 515 // NOTE: It is OK (in fact, it's probably a good idea) to call this before
520 // having received OnInitializationCompleted. 516 // having received OnInitializationCompleted.
521 void AddObserver(Observer* observer); 517 void AddObserver(Observer* observer);
522 518
523 // Remove the given observer. Make sure to call this if the 519 // Remove the given observer. Make sure to call this if the
524 // Observer is being destroyed so the SyncManager doesn't 520 // Observer is being destroyed so the SyncManager doesn't
525 // potentially dereference garbage. 521 // potentially dereference garbage.
526 void RemoveObserver(Observer* observer); 522 void RemoveObserver(Observer* observer);
527 523
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 sync_api::UserShare* share); 625 sync_api::UserShare* share);
630 626
631 const char* ConnectionStatusToString(ConnectionStatus status); 627 const char* ConnectionStatusToString(ConnectionStatus status);
632 628
633 // Returns the string representation of a PassphraseRequiredReason value. 629 // Returns the string representation of a PassphraseRequiredReason value.
634 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason); 630 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason);
635 631
636 } // namespace sync_api 632 } // namespace sync_api
637 633
638 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ 634 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698