| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 xmpp_client_settings.set_pass( | 292 xmpp_client_settings.set_pass( |
| 293 talk_base::CryptString(insecure_crypt_string)); | 293 talk_base::CryptString(insecure_crypt_string)); |
| 294 talk_base::SocketAddress addr(server, port); | 294 talk_base::SocketAddress addr(server, port); |
| 295 if (!addr.ResolveIP()) { | 295 if (!addr.ResolveIP()) { |
| 296 LOG(ERROR) << "Could not resolve " << addr.ToString(); | 296 LOG(ERROR) << "Could not resolve " << addr.ToString(); |
| 297 return -1; | 297 return -1; |
| 298 } | 298 } |
| 299 xmpp_client_settings.set_server(addr); | 299 xmpp_client_settings.set_server(addr); |
| 300 | 300 |
| 301 net::CertVerifier cert_verifier; | 301 net::CertVerifier cert_verifier; |
| 302 | |
| 303 MessageLoopForIO message_loop; | 302 MessageLoopForIO message_loop; |
| 304 | 303 |
| 305 // Connect and listen. | 304 // Connect and listen. |
| 306 ServerNotifierDelegate server_notifier_delegate( | 305 ServerNotifierDelegate server_notifier_delegate( |
| 307 server_notifier_state); | 306 server_notifier_state); |
| 308 LegacyNotifierDelegate legacy_notifier_delegate( | 307 LegacyNotifierDelegate legacy_notifier_delegate( |
| 309 legacy_notifier_send_initial_update); | 308 legacy_notifier_send_initial_update); |
| 310 std::vector<XmppNotificationClient::Observer*> observers; | 309 std::vector<XmppNotificationClient::Observer*> observers; |
| 311 if (use_legacy_notifier) { | 310 if (use_legacy_notifier) { |
| 312 observers.push_back(&legacy_notifier_delegate); | 311 observers.push_back(&legacy_notifier_delegate); |
| 313 } else { | 312 } else { |
| 314 observers.push_back(&server_notifier_delegate); | 313 observers.push_back(&server_notifier_delegate); |
| 315 } | 314 } |
| 316 XmppNotificationClient xmpp_notification_client( | 315 XmppNotificationClient xmpp_notification_client( |
| 317 observers.begin(), observers.end()); | 316 observers.begin(), observers.end()); |
| 318 xmpp_notification_client.Run(xmpp_client_settings, &cert_verifier); | 317 xmpp_notification_client.Run(xmpp_client_settings, &cert_verifier); |
| 319 | 318 |
| 320 return 0; | 319 return 0; |
| 321 } | 320 } |
| OLD | NEW |