diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:03:15 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:03:15 +0000 |
commit | f73e174dbd1fcd3ef9ca23dbe0a4e789068ee020 (patch) | |
tree | a6f7446f28a742d9b190fd78ee8276245d3bca8d /chrome/browser/sync/tools | |
parent | 833d617cffb3de3e90638d963a73aa7158b6843a (diff) | |
download | chromium_src-f73e174dbd1fcd3ef9ca23dbe0a4e789068ee020.zip chromium_src-f73e174dbd1fcd3ef9ca23dbe0a4e789068ee020.tar.gz chromium_src-f73e174dbd1fcd3ef9ca23dbe0a4e789068ee020.tar.bz2 |
Removed use of XmppSocketAdapter by sync.
Moved XmppSocketAdapter and friends to remoting directory.
Removed some dead code in jingle/.
This is a relanding of 59012, which was mistakenly reverted at 59104.
BUG=54146,55116
TEST=none
TBR=willchan
Review URL: http://codereview.chromium.org/3300030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/tools')
-rw-r--r-- | chrome/browser/sync/tools/sync_listen_notifications.cc | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/chrome/browser/sync/tools/sync_listen_notifications.cc b/chrome/browser/sync/tools/sync_listen_notifications.cc index 0a7751d..5fdc9f9 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); 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; } |