| 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 #ifndef JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 5 #ifndef JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
| 6 #define JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 6 #define JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class SingleLoginAttempt; | 42 class SingleLoginAttempt; |
| 43 | 43 |
| 44 // Does the login, keeps it alive (with refreshing cookies and reattempting | 44 // Does the login, keeps it alive (with refreshing cookies and reattempting |
| 45 // login when disconnected), figures out what actions to take on the various | 45 // login when disconnected), figures out what actions to take on the various |
| 46 // errors that may occur. | 46 // errors that may occur. |
| 47 class Login : public net::NetworkChangeNotifier::Observer, | 47 class Login : public net::NetworkChangeNotifier::Observer, |
| 48 public sigslot::has_slots<> { | 48 public sigslot::has_slots<> { |
| 49 public: | 49 public: |
| 50 // firewall may be NULL. | 50 // firewall may be NULL. |
| 51 Login(talk_base::TaskParent* parent, | 51 Login(talk_base::TaskParent* parent, |
| 52 bool use_chrome_async_socket, | |
| 53 const buzz::XmppClientSettings& user_settings, | 52 const buzz::XmppClientSettings& user_settings, |
| 54 const ConnectionOptions& options, | 53 const ConnectionOptions& options, |
| 55 std::string lang, | 54 std::string lang, |
| 56 net::HostResolver* host_resolver, | 55 net::HostResolver* host_resolver, |
| 57 ServerInformation* server_list, | 56 ServerInformation* server_list, |
| 58 int server_count, | 57 int server_count, |
| 59 talk_base::FirewallManager* firewall, | 58 talk_base::FirewallManager* firewall, |
| 60 bool try_ssltcp_first, | 59 bool try_ssltcp_first, |
| 61 bool proxy_only); | 60 bool proxy_only); |
| 62 virtual ~Login(); | 61 virtual ~Login(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 91 | 90 |
| 92 // Tries to reconnect in some point in the future. If called | 91 // Tries to reconnect in some point in the future. If called |
| 93 // repeatedly, will wait longer and longer until reconnecting. | 92 // repeatedly, will wait longer and longer until reconnecting. |
| 94 void TryReconnect(); | 93 void TryReconnect(); |
| 95 | 94 |
| 96 // The actual function (called by |reconnect_timer_|) that does the | 95 // The actual function (called by |reconnect_timer_|) that does the |
| 97 // reconnection. | 96 // reconnection. |
| 98 void DoReconnect(); | 97 void DoReconnect(); |
| 99 | 98 |
| 100 talk_base::TaskParent* parent_; | 99 talk_base::TaskParent* parent_; |
| 101 bool use_chrome_async_socket_; | |
| 102 scoped_ptr<LoginSettings> login_settings_; | 100 scoped_ptr<LoginSettings> login_settings_; |
| 103 LoginConnectionState state_; | 101 LoginConnectionState state_; |
| 104 SingleLoginAttempt* single_attempt_; | 102 SingleLoginAttempt* single_attempt_; |
| 105 | 103 |
| 106 // reconnection state. | 104 // reconnection state. |
| 107 base::TimeDelta reconnect_interval_; | 105 base::TimeDelta reconnect_interval_; |
| 108 base::OneShotTimer<Login> reconnect_timer_; | 106 base::OneShotTimer<Login> reconnect_timer_; |
| 109 | 107 |
| 110 // server redirect information | 108 // server redirect information |
| 111 base::Time redirect_time_; | 109 base::Time redirect_time_; |
| 112 std::string redirect_server_; | 110 std::string redirect_server_; |
| 113 int redirect_port_; | 111 int redirect_port_; |
| 114 | 112 |
| 115 DISALLOW_COPY_AND_ASSIGN(Login); | 113 DISALLOW_COPY_AND_ASSIGN(Login); |
| 116 }; | 114 }; |
| 117 | 115 |
| 118 } // namespace notifier | 116 } // namespace notifier |
| 119 | 117 |
| 120 #endif // JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ | 118 #endif // JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ |
| OLD | NEW |