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

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

Issue 4275001: [Sync] Removed more uses of libjingle's sigslot (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 2 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
« no previous file with comments | « jingle/notifier/communicator/login.h ('k') | jingle/notifier/communicator/single_login_attempt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/notifier/communicator/login.cc
diff --git a/jingle/notifier/communicator/login.cc b/jingle/notifier/communicator/login.cc
index c12ca0603227bcb1741a662b6d7688f03f59ff35..33a21245fd35bf3258328eb2805718aaf3312f01 100644
--- a/jingle/notifier/communicator/login.cc
+++ b/jingle/notifier/communicator/login.cc
@@ -30,13 +30,15 @@ namespace notifier {
// Redirect valid for 5 minutes.
static const int kRedirectTimeoutMinutes = 5;
-Login::Login(const buzz::XmppClientSettings& user_settings,
+Login::Login(Delegate* delegate,
+ const buzz::XmppClientSettings& user_settings,
const ConnectionOptions& options,
net::HostResolver* host_resolver,
ServerInformation* server_list,
int server_count,
bool try_ssltcp_first)
- : login_settings_(new LoginSettings(user_settings,
+ : delegate_(delegate),
+ login_settings_(new LoginSettings(user_settings,
options,
host_resolver,
server_list,
@@ -66,16 +68,16 @@ void Login::StartConnection() {
VLOG(1) << "Starting connection...";
- single_attempt_.reset(new SingleLoginAttempt(login_settings_.get()));
+ single_attempt_.reset(new SingleLoginAttempt(login_settings_.get(), this));
+}
+
+void Login::OnConnect(base::WeakPtr<talk_base::Task> base_task) {
+ ResetReconnectState();
+ delegate_->OnConnect(base_task);
+}
- // Do the signaling hook-ups.
- single_attempt_->SignalNeedAutoReconnect.connect(
- this,
- &Login::TryReconnect);
- single_attempt_->SignalRedirect.connect(this, &Login::OnRedirect);
- single_attempt_->SignalConnect.connect(
- this,
- &Login::OnConnect);
+void Login::OnNeedReconnect() {
+ TryReconnect();
}
void Login::OnRedirect(const std::string& redirect_server, int redirect_port) {
@@ -89,11 +91,6 @@ void Login::OnRedirect(const std::string& redirect_server, int redirect_port) {
StartConnection();
}
-void Login::OnConnect(base::WeakPtr<talk_base::Task> base_task) {
- ResetReconnectState();
- SignalConnect(base_task);
-}
-
void Login::OnIPAddressChanged() {
VLOG(1) << "Detected IP address change";
// Reconnect in 1 to 9 seconds (vary the time a little to try to
@@ -116,7 +113,7 @@ void Login::TryReconnect() {
<< reconnect_interval_.InSeconds() << " seconds";
reconnect_timer_.Start(
reconnect_interval_, this, &Login::DoReconnect);
- SignalDisconnect();
+ delegate_->OnDisconnect();
}
void Login::DoReconnect() {
« no previous file with comments | « jingle/notifier/communicator/login.h ('k') | jingle/notifier/communicator/single_login_attempt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698