Chromium Code Reviews| Index: chrome/browser/sync/tools/sync_listen_notifications.cc |
| diff --git a/chrome/browser/sync/tools/sync_listen_notifications.cc b/chrome/browser/sync/tools/sync_listen_notifications.cc |
| index 0a7751daa522890d0c8dcb1f567e313357cf4a83..5fdc9f9e2330ee90c2e315bb374688292215d60d 100644 |
| --- a/chrome/browser/sync/tools/sync_listen_notifications.cc |
| +++ b/chrome/browser/sync/tools/sync_listen_notifications.cc |
| @@ -21,7 +21,6 @@ |
| #include "jingle/notifier/base/notification_method.h" |
| #include "jingle/notifier/base/task_pump.h" |
| #include "jingle/notifier/base/xmpp_client_socket_factory.h" |
| -#include "jingle/notifier/communicator/xmpp_socket_adapter.h" |
| #include "jingle/notifier/listener/listen_task.h" |
| #include "jingle/notifier/listener/notification_constants.h" |
| #include "jingle/notifier/listener/subscribe_task.h" |
| @@ -30,9 +29,6 @@ |
| #include "talk/base/cryptstring.h" |
| #include "talk/base/logging.h" |
| #include "talk/base/sigslot.h" |
| -#include "talk/base/physicalsocketserver.h" |
| -#include "talk/base/ssladapter.h" |
| -#include "talk/base/thread.h" |
| #include "talk/xmpp/jid.h" |
| #include "talk/xmpp/xmppclient.h" |
| #include "talk/xmpp/xmppclientsettings.h" |
| @@ -45,14 +41,6 @@ |
| namespace { |
| -void PumpAuxiliaryLoops() { |
| - talk_base::Thread* current_thread = |
| - talk_base::ThreadManager::CurrentThread(); |
| - current_thread->ProcessMessages(100); |
| - MessageLoop::current()->PostTask( |
| - FROM_HERE, NewRunnableFunction(&PumpAuxiliaryLoops)); |
| -} |
| - |
| // Main class that listens for and handles messages from the XMPP |
| // client. |
| class XmppNotificationClient : public sigslot::has_slots<> { |
| @@ -84,8 +72,7 @@ class XmppNotificationClient : public sigslot::has_slots<> { |
| } |
| // Connect with the given XMPP settings and run until disconnected. |
| - void Run(const buzz::XmppClientSettings& xmpp_client_settings, |
| - bool use_chrome_async_socket) { |
| + void Run(const buzz::XmppClientSettings& xmpp_client_settings) { |
| CHECK(!xmpp_client_); |
| xmpp_client_settings_ = xmpp_client_settings; |
| xmpp_client_ = new buzz::XmppClient(&task_pump_); |
| @@ -101,15 +88,11 @@ class XmppNotificationClient : public sigslot::has_slots<> { |
| bool use_fake_ssl_client_socket = |
| (xmpp_client_settings.protocol() == cricket::PROTO_SSLTCP); |
| buzz::AsyncSocket* buzz_async_socket = |
| - use_chrome_async_socket ? |
| - static_cast<buzz::AsyncSocket*>( |
| - new notifier::ChromeAsyncSocket( |
| - new notifier::XmppClientSocketFactory( |
| - net::ClientSocketFactory::GetDefaultFactory(), |
| - use_fake_ssl_client_socket), |
| - ssl_config, 4096, 64 * 1024, NULL)) : |
| - static_cast<buzz::AsyncSocket*>( |
| - new notifier::XmppSocketAdapter(xmpp_client_settings_, false)); |
| + new notifier::ChromeAsyncSocket( |
| + new notifier::XmppClientSocketFactory( |
| + net::ClientSocketFactory::GetDefaultFactory(), |
| + use_fake_ssl_client_socket), |
| + ssl_config, 4096, 64 * 1024, NULL); |
|
tim (not reviewing)
2010/09/09 22:44:35
would be nice if these numbers were constants
akalin
2010/09/09 22:47:35
Will do, as separate CL.
On 2010/09/09 22:44:35,
|
| CHECK(buzz_async_socket); |
| // Transfers ownership of buzz_async_socket. |
| buzz::XmppReturnStatus connect_status = |
| @@ -117,10 +100,6 @@ class XmppNotificationClient : public sigslot::has_slots<> { |
| buzz_async_socket, NULL); |
| CHECK_EQ(connect_status, buzz::XMPP_RETURN_OK); |
| xmpp_client_->Start(); |
| - if (!use_chrome_async_socket) { |
| - MessageLoop::current()->PostTask( |
| - FROM_HERE, NewRunnableFunction(&PumpAuxiliaryLoops)); |
| - } |
| MessageLoop::current()->Run(); |
| DCHECK(!xmpp_client_); |
| } |
| @@ -343,11 +322,6 @@ int main(int argc, char* argv[]) { |
| } |
| xmpp_client_settings.set_server(addr); |
| - // Set up message loops and socket servers. |
| - talk_base::PhysicalSocketServer physical_socket_server; |
| - talk_base::InitializeSSL(); |
| - talk_base::Thread main_thread(&physical_socket_server); |
| - talk_base::ThreadManager::SetCurrent(&main_thread); |
| MessageLoopForIO message_loop; |
| // Connect and listen. |
| @@ -361,11 +335,8 @@ int main(int argc, char* argv[]) { |
| } |
| // TODO(akalin): Revert the move of all switches in this file into |
| // chrome_switches.h. |
| - bool use_chrome_async_socket = |
| - command_line.HasSwitch("use-chrome-async-socket"); |
| XmppNotificationClient xmpp_notification_client(delegate); |
| - xmpp_notification_client.Run(xmpp_client_settings, |
| - use_chrome_async_socket); |
| + xmpp_notification_client.Run(xmpp_client_settings); |
| return 0; |
| } |