OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "jingle/notifier/communicator/login.h" | 5 #include "jingle/notifier/communicator/login.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Redirect valid for 5 minutes. | 30 // Redirect valid for 5 minutes. |
31 static const int kRedirectTimeoutMinutes = 5; | 31 static const int kRedirectTimeoutMinutes = 5; |
32 | 32 |
33 Login::Login(Delegate* delegate, | 33 Login::Login(Delegate* delegate, |
34 const buzz::XmppClientSettings& user_settings, | 34 const buzz::XmppClientSettings& user_settings, |
35 const ConnectionOptions& options, | 35 const ConnectionOptions& options, |
36 net::HostResolver* host_resolver, | 36 net::HostResolver* host_resolver, |
37 net::CertVerifier* cert_verifier, | 37 net::CertVerifier* cert_verifier, |
38 ServerInformation* server_list, | 38 ServerInformation* server_list, |
39 int server_count, | 39 int server_count, |
40 bool try_ssltcp_first) | 40 bool try_ssltcp_first, |
| 41 const std::string& auth_mechanism) |
41 : delegate_(delegate), | 42 : delegate_(delegate), |
42 login_settings_(new LoginSettings(user_settings, | 43 login_settings_(new LoginSettings(user_settings, |
43 options, | 44 options, |
44 host_resolver, | 45 host_resolver, |
45 cert_verifier, | 46 cert_verifier, |
46 server_list, | 47 server_list, |
47 server_count, | 48 server_count, |
48 try_ssltcp_first)), | 49 try_ssltcp_first, |
| 50 auth_mechanism)), |
49 redirect_port_(0) { | 51 redirect_port_(0) { |
50 net::NetworkChangeNotifier::AddIPAddressObserver(this); | 52 net::NetworkChangeNotifier::AddIPAddressObserver(this); |
51 ResetReconnectState(); | 53 ResetReconnectState(); |
52 } | 54 } |
53 | 55 |
54 Login::~Login() { | 56 Login::~Login() { |
55 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); | 57 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |
56 } | 58 } |
57 | 59 |
58 void Login::StartConnection() { | 60 void Login::StartConnection() { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 const base::TimeDelta kMaxReconnectInterval = | 125 const base::TimeDelta kMaxReconnectInterval = |
124 base::TimeDelta::FromMinutes(30); | 126 base::TimeDelta::FromMinutes(30); |
125 reconnect_interval_ *= 2; | 127 reconnect_interval_ *= 2; |
126 if (reconnect_interval_ > kMaxReconnectInterval) | 128 if (reconnect_interval_ > kMaxReconnectInterval) |
127 reconnect_interval_ = kMaxReconnectInterval; | 129 reconnect_interval_ = kMaxReconnectInterval; |
128 VLOG(1) << "Reconnecting..."; | 130 VLOG(1) << "Reconnecting..."; |
129 StartConnection(); | 131 StartConnection(); |
130 } | 132 } |
131 | 133 |
132 } // namespace notifier | 134 } // namespace notifier |
OLD | NEW |