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

Unified Diff: jingle/notifier/communicator/single_login_attempt.cc

Issue 10545170: [Sync] Propagate XMPP auth errors to SyncNotifierObservers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix deps, win 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/single_login_attempt.cc
diff --git a/jingle/notifier/communicator/single_login_attempt.cc b/jingle/notifier/communicator/single_login_attempt.cc
index 0c789ee49745457f60ca120a5d437af62baf9903..c2405fe0187653ae74b2ef2ddb4e8d81570cd179 100644
--- a/jingle/notifier/communicator/single_login_attempt.cc
+++ b/jingle/notifier/communicator/single_login_attempt.cc
@@ -39,6 +39,11 @@ SingleLoginAttempt::SingleLoginAttempt(const LoginSettings& login_settings,
SingleLoginAttempt::~SingleLoginAttempt() {}
+// In the code below, we assume that calling a delegate method may end
+// up in ourselves being deleted, so we always call it last.
+//
+// TODO(akalin): Add unit tests to enforce the behavior above.
+
void SingleLoginAttempt::OnConnect(
base::WeakPtr<buzz::XmppTaskParentInterface> base_task) {
DVLOG(1) << "Connected to " << current_settings_->ToString();
@@ -131,6 +136,11 @@ void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode,
}
}
+ if (error == buzz::XmppEngine::ERROR_UNAUTHORIZED) {
+ delegate_->OnCredentialsRejected();
+ return;
+ }
+
if (current_settings_ == settings_list_.end()) {
NOTREACHED();
return;
@@ -139,7 +149,7 @@ void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode,
++current_settings_;
if (current_settings_ == settings_list_.end()) {
VLOG(1) << "Could not connect to any XMPP server";
- delegate_->OnNeedReconnect();
+ delegate_->OnSettingsExhausted();
return;
}

Powered by Google App Engine
This is Rietveld 408576698