| 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 "remoting/jingle_glue/jingle_client.h" | 5 #include "remoting/jingle_glue/jingle_client.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "jingle/notifier/communicator/gaia_token_pre_xmpp_auth.h" | 9 #include "jingle/notifier/communicator/gaia_token_pre_xmpp_auth.h" |
| 10 #include "jingle/notifier/communicator/xmpp_socket_adapter.h" | |
| 11 #include "remoting/jingle_glue/iq_request.h" | 10 #include "remoting/jingle_glue/iq_request.h" |
| 12 #include "remoting/jingle_glue/jingle_thread.h" | 11 #include "remoting/jingle_glue/jingle_thread.h" |
| 13 #include "remoting/jingle_glue/relay_port_allocator.h" | 12 #include "remoting/jingle_glue/relay_port_allocator.h" |
| 13 #include "remoting/jingle_glue/xmpp_socket_adapter.h" |
| 14 #include "third_party/libjingle/source/talk/base/asyncsocket.h" | 14 #include "third_party/libjingle/source/talk/base/asyncsocket.h" |
| 15 #include "third_party/libjingle/source/talk/base/ssladapter.h" | 15 #include "third_party/libjingle/source/talk/base/ssladapter.h" |
| 16 #include "third_party/libjingle/source/talk/p2p/base/sessionmanager.h" | 16 #include "third_party/libjingle/source/talk/p2p/base/sessionmanager.h" |
| 17 #include "third_party/libjingle/source/talk/p2p/base/transport.h" | 17 #include "third_party/libjingle/source/talk/p2p/base/transport.h" |
| 18 #include "third_party/libjingle/source/talk/p2p/client/sessionmanagertask.h" | 18 #include "third_party/libjingle/source/talk/p2p/client/sessionmanagertask.h" |
| 19 #include "third_party/libjingle/source/talk/session/tunnel/tunnelsessionclient.h
" | 19 #include "third_party/libjingle/source/talk/session/tunnel/tunnelsessionclient.h
" |
| 20 #include "third_party/libjingle/source/talk/xmpp/prexmppauth.h" | 20 #include "third_party/libjingle/source/talk/xmpp/prexmppauth.h" |
| 21 #include "third_party/libjingle/source/talk/xmpp/saslcookiemechanism.h" | 21 #include "third_party/libjingle/source/talk/xmpp/saslcookiemechanism.h" |
| 22 | 22 |
| 23 namespace remoting { | 23 namespace remoting { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 settings.set_resource("chromoting"); | 87 settings.set_resource("chromoting"); |
| 88 settings.set_use_tls(true); | 88 settings.set_use_tls(true); |
| 89 settings.set_token_service(auth_token_service); | 89 settings.set_token_service(auth_token_service); |
| 90 settings.set_auth_cookie(auth_token); | 90 settings.set_auth_cookie(auth_token); |
| 91 settings.set_server(talk_base::SocketAddress("talk.google.com", 5222)); | 91 settings.set_server(talk_base::SocketAddress("talk.google.com", 5222)); |
| 92 | 92 |
| 93 client_ = new buzz::XmppClient(thread_->task_pump()); | 93 client_ = new buzz::XmppClient(thread_->task_pump()); |
| 94 client_->SignalStateChange.connect( | 94 client_->SignalStateChange.connect( |
| 95 this, &JingleClient::OnConnectionStateChanged); | 95 this, &JingleClient::OnConnectionStateChanged); |
| 96 | 96 |
| 97 buzz::AsyncSocket* socket = new notifier::XmppSocketAdapter(settings, false); | 97 buzz::AsyncSocket* socket = new XmppSocketAdapter(settings, false); |
| 98 | 98 |
| 99 client_->Connect(settings, "", socket, CreatePreXmppAuth(settings)); | 99 client_->Connect(settings, "", socket, CreatePreXmppAuth(settings)); |
| 100 client_->Start(); | 100 client_->Start(); |
| 101 | 101 |
| 102 network_manager_.reset(new talk_base::NetworkManager()); | 102 network_manager_.reset(new talk_base::NetworkManager()); |
| 103 | 103 |
| 104 RelayPortAllocator* port_allocator = | 104 RelayPortAllocator* port_allocator = |
| 105 new RelayPortAllocator(network_manager_.get(), "transp2"); | 105 new RelayPortAllocator(network_manager_.get(), "transp2"); |
| 106 port_allocator_.reset(port_allocator); | 106 port_allocator_.reset(port_allocator); |
| 107 port_allocator->SetJingleInfo(client_); | 107 port_allocator->SetJingleInfo(client_); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 260 } |
| 261 | 261 |
| 262 buzz::PreXmppAuth* JingleClient::CreatePreXmppAuth( | 262 buzz::PreXmppAuth* JingleClient::CreatePreXmppAuth( |
| 263 const buzz::XmppClientSettings& settings) { | 263 const buzz::XmppClientSettings& settings) { |
| 264 buzz::Jid jid(settings.user(), settings.host(), buzz::STR_EMPTY); | 264 buzz::Jid jid(settings.user(), settings.host(), buzz::STR_EMPTY); |
| 265 return new notifier::GaiaTokenPreXmppAuth(jid.Str(), settings.auth_cookie(), | 265 return new notifier::GaiaTokenPreXmppAuth(jid.Str(), settings.auth_cookie(), |
| 266 settings.token_service()); | 266 settings.token_service()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace remoting | 269 } // namespace remoting |
| OLD | NEW |