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

Unified Diff: jingle/notifier/communicator/login.h

Issue 10545170: [Sync] Propagate XMPP auth errors to SyncNotifierObservers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error 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 side-by-side diff with in-line comments
Download patch
Index: jingle/notifier/communicator/login.h
diff --git a/jingle/notifier/communicator/login.h b/jingle/notifier/communicator/login.h
index d089cb6d62918c3b31b707a1d2e1833c07660191..30bc168fe2ba74f03a4ebd7f6c15ffba7f9cc95d 100644
--- a/jingle/notifier/communicator/login.h
+++ b/jingle/notifier/communicator/login.h
@@ -33,24 +33,29 @@ namespace notifier {
class LoginSettings;
-// Workaround for MSVS 2005 bug that fails to handle inheritance from a nested
-// class properly if it comes directly on a base class list.
-typedef SingleLoginAttempt::Delegate SingleLoginAttemptDelegate;
-
-// Does the login, keeps it alive (with refreshing cookies and reattempting
-// login when disconnected), figures out what actions to take on the various
-// errors that may occur.
+// Does the login, keeps it alive (with refreshing cookies and
+// reattempting login when disconnected), and figures out what actions
+// to take on the various errors that may occur.
class Login : public net::NetworkChangeNotifier::IPAddressObserver,
- public SingleLoginAttemptDelegate {
+ public SingleLoginAttempt::Delegate {
public:
class Delegate {
public:
+ // Called when a connection has been successfully established.
virtual void OnConnect(
base::WeakPtr<buzz::XmppTaskParentInterface> base_task) = 0;
+
+ // Called when we've detected a disconnection. A reconnection
+ // will be attempted. May be called multiple times in a row.
virtual void OnDisconnect() = 0;
+ // Called when our credentials have been rejected. Will not try
+ // to reconnect after this (although the client may still call
+ // StartConnection(), perhaps after calling UpdateXmppSettings()).
+ virtual void OnRejectedCredentials() = 0;
+
protected:
- virtual ~Delegate() {}
+ virtual ~Delegate();
};
// Does not take ownership of |delegate|, which must not be NULL.
@@ -63,9 +68,12 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver,
const std::string& auth_mechanism);
virtual ~Login();
+ // Starts connecting (or forces a reconnection if we're backed off).
void StartConnection();
- // The updated settings only take effect the next time StartConnection
- // is called.
+
+ // The updated settings take effect only the next time when a
+ // connection is attempted (either via reconnection or a call to
+ // StartConnection()).
void UpdateXmppSettings(const buzz::XmppClientSettings& user_settings);
// net::NetworkChangeNotifier::IPAddressObserver implementation.
@@ -76,6 +84,7 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver,
base::WeakPtr<buzz::XmppTaskParentInterface> base_task) OVERRIDE;
virtual void OnNeedReconnect() OVERRIDE;
virtual void OnRedirect(const ServerInformation& redirect_server) OVERRIDE;
+ virtual void OnRejectedCredentials() OVERRIDE;
private:
void OnLogoff();
@@ -103,10 +112,6 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver,
DISALLOW_COPY_AND_ASSIGN(Login);
};
-// Workaround for MSVS 2005 bug that fails to handle inheritance from a nested
-// class properly if it comes directly on a base class list.
-typedef Login::Delegate LoginDelegate;
-
} // namespace notifier
#endif // JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_

Powered by Google App Engine
This is Rietveld 408576698