| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ios/bridge/client_instance.h" | 5 #include "remoting/ios/bridge/client_instance.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "net/socket/client_socket_factory.h" | 10 #include "net/socket/client_socket_factory.h" |
| 11 #include "remoting/base/url_request_context_getter.h" | 11 #include "remoting/base/url_request_context_getter.h" |
| 12 #include "remoting/client/audio_player.h" | 12 #include "remoting/client/audio_player.h" |
| 13 #include "remoting/client/plugin/delegating_signal_strategy.h" | 13 #include "remoting/client/plugin/delegating_signal_strategy.h" |
| 14 #include "remoting/ios/bridge/client_proxy.h" | 14 #include "remoting/ios/bridge/client_proxy.h" |
| 15 #include "remoting/jingle_glue/chromium_port_allocator.h" | 15 #include "remoting/protocol/chromium_port_allocator.h" |
| 16 #include "remoting/protocol/host_stub.h" | 16 #include "remoting/protocol/host_stub.h" |
| 17 #include "remoting/protocol/libjingle_transport_factory.h" | 17 #include "remoting/protocol/libjingle_transport_factory.h" |
| 18 #include "remoting/protocol/negotiating_client_authenticator.h" | 18 #include "remoting/protocol/negotiating_client_authenticator.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 const char* const kXmppServer = "talk.google.com"; | 21 const char* const kXmppServer = "talk.google.com"; |
| 22 const int kXmppPort = 5222; | 22 const int kXmppPort = 5222; |
| 23 const bool kXmppUseTls = true; | 23 const bool kXmppUseTls = true; |
| 24 | 24 |
| 25 void DoNothing() {} | 25 void DoNothing() {} |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 client_.reset(new ChromotingClient(client_context_.get(), | 339 client_.reset(new ChromotingClient(client_context_.get(), |
| 340 this, | 340 this, |
| 341 video_renderer_.get(), | 341 video_renderer_.get(), |
| 342 scoped_ptr<AudioPlayer>())); | 342 scoped_ptr<AudioPlayer>())); |
| 343 | 343 |
| 344 signaling_.reset( | 344 signaling_.reset( |
| 345 new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(), | 345 new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(), |
| 346 url_requester_, | 346 url_requester_, |
| 347 xmpp_config_)); | 347 xmpp_config_)); |
| 348 | 348 |
| 349 NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_ENABLED); | 349 protocol::NetworkSettings network_settings( |
| 350 protocol::NetworkSettings::NAT_TRAVERSAL_ENABLED); |
| 350 | 351 |
| 351 scoped_ptr<ChromiumPortAllocator> port_allocator( | 352 scoped_ptr<protocol::ChromiumPortAllocator> port_allocator( |
| 352 ChromiumPortAllocator::Create(url_requester_, network_settings)); | 353 protocol::ChromiumPortAllocator::Create(url_requester_, |
| 354 network_settings)); |
| 353 | 355 |
| 354 scoped_ptr<protocol::TransportFactory> transport_factory( | 356 scoped_ptr<protocol::TransportFactory> transport_factory( |
| 355 new protocol::LibjingleTransportFactory( | 357 new protocol::LibjingleTransportFactory( |
| 356 signaling_.get(), | 358 signaling_.get(), |
| 357 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), | 359 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), |
| 358 network_settings)); | 360 network_settings)); |
| 359 | 361 |
| 360 client_->Start(signaling_.get(), authenticator_.Pass(), | 362 client_->Start(signaling_.get(), authenticator_.Pass(), |
| 361 transport_factory.Pass(), host_jid_, std::string()); | 363 transport_factory.Pass(), host_jid_, std::string()); |
| 362 | 364 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 373 // |client_| must be torn down before |signaling_|. | 375 // |client_| must be torn down before |signaling_|. |
| 374 client_.reset(); | 376 client_.reset(); |
| 375 signaling_.reset(); | 377 signaling_.reset(); |
| 376 video_renderer_.reset(); | 378 video_renderer_.reset(); |
| 377 client_context_->Stop(); | 379 client_context_->Stop(); |
| 378 if (!done.is_null()) | 380 if (!done.is_null()) |
| 379 done.Run(); | 381 done.Run(); |
| 380 } | 382 } |
| 381 | 383 |
| 382 } // namespace remoting | 384 } // namespace remoting |
| OLD | NEW |