OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file defines the "sync API", an interface to the syncer | 5 // This file defines the "sync API", an interface to the syncer |
6 // backend that exposes (1) the core functionality of maintaining a consistent | 6 // backend that exposes (1) the core functionality of maintaining a consistent |
7 // local snapshot of a hierarchical object set; (2) a means to transactionally | 7 // local snapshot of a hierarchical object set; (2) a means to transactionally |
8 // access and modify those objects; (3) a means to control client/server | 8 // access and modify those objects; (3) a means to control client/server |
9 // synchronization tasks, namely: pushing local object modifications to a | 9 // synchronization tasks, namely: pushing local object modifications to a |
10 // server, pulling nonlocal object modifications from a server to this client, | 10 // server, pulling nonlocal object modifications from a server to this client, |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 // Returns empty if there is no such username. | 515 // Returns empty if there is no such username. |
516 const std::string& GetAuthenticatedUsername(); | 516 const std::string& GetAuthenticatedUsername(); |
517 | 517 |
518 // Submit credentials to GAIA for verification and start the | 518 // Submit credentials to GAIA for verification and start the |
519 // syncing process on success. On success, both |username| and the obtained | 519 // syncing process on success. On success, both |username| and the obtained |
520 // auth token are persisted on disk for future re-use. | 520 // auth token are persisted on disk for future re-use. |
521 // If authentication fails, OnAuthProblem is called on our Observer. | 521 // If authentication fails, OnAuthProblem is called on our Observer. |
522 // The Observer may, in turn, decide to try again with new | 522 // The Observer may, in turn, decide to try again with new |
523 // credentials. Calling this method again is the appropriate course of action | 523 // credentials. Calling this method again is the appropriate course of action |
524 // to "retry". | 524 // to "retry". |
525 // |username| and |password| are expected to be owned by the caller. | 525 // |username|, |password|, and |captcha| are owned by the caller. |
526 void Authenticate(const char* username, const char* password); | 526 void Authenticate(const char* username, const char* password, |
| 527 const char* captcha); |
527 | 528 |
528 // Adds a listener to be notified of sync events. | 529 // Adds a listener to be notified of sync events. |
529 // NOTE: It is OK (in fact, it's probably a good idea) to call this before | 530 // NOTE: It is OK (in fact, it's probably a good idea) to call this before |
530 // having received OnInitializationCompleted. | 531 // having received OnInitializationCompleted. |
531 void SetObserver(Observer* observer); | 532 void SetObserver(Observer* observer); |
532 | 533 |
533 // Remove the observer set by SetObserver (no op if none was set). | 534 // Remove the observer set by SetObserver (no op if none was set). |
534 // Make sure to call this if the Observer set in SetObserver is being | 535 // Make sure to call this if the Observer set in SetObserver is being |
535 // destroyed so the SyncManager doesn't potentially dereference garbage. | 536 // destroyed so the SyncManager doesn't potentially dereference garbage. |
536 void RemoveObserver(); | 537 void RemoveObserver(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 // Subclasses should implement to invoke DoWork on |visitor| once on a thread | 659 // Subclasses should implement to invoke DoWork on |visitor| once on a thread |
659 // appropriate for data model modifications. | 660 // appropriate for data model modifications. |
660 // While it doesn't hurt, the impl does not need to be re-entrant (for now). | 661 // While it doesn't hurt, the impl does not need to be re-entrant (for now). |
661 // Note: |visitor| is owned by caller. | 662 // Note: |visitor| is owned by caller. |
662 virtual void CallDoWorkFromModelSafeThreadAndWait(Visitor* visitor) = 0; | 663 virtual void CallDoWorkFromModelSafeThreadAndWait(Visitor* visitor) = 0; |
663 }; | 664 }; |
664 | 665 |
665 } // namespace sync_api | 666 } // namespace sync_api |
666 | 667 |
667 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 668 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |