| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/client/jni/chromoting_jni_instance.h" | 5 #include "remoting/client/jni/chromoting_jni_instance.h" |
| 6 | 6 |
| 7 #include <android/log.h> | 7 #include <android/log.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "jingle/glue/thread_wrapper.h" | 11 #include "jingle/glue/thread_wrapper.h" |
| 12 #include "net/socket/client_socket_factory.h" | 12 #include "net/socket/client_socket_factory.h" |
| 13 #include "remoting/base/service_urls.h" | 13 #include "remoting/base/service_urls.h" |
| 14 #include "remoting/client/audio_player.h" | 14 #include "remoting/client/audio_player.h" |
| 15 #include "remoting/client/client_status_logger.h" | 15 #include "remoting/client/client_status_logger.h" |
| 16 #include "remoting/client/jni/android_keymap.h" | 16 #include "remoting/client/jni/android_keymap.h" |
| 17 #include "remoting/client/jni/chromoting_jni_runtime.h" | 17 #include "remoting/client/jni/chromoting_jni_runtime.h" |
| 18 #include "remoting/client/jni/jni_frame_consumer.h" | 18 #include "remoting/client/jni/jni_frame_consumer.h" |
| 19 #include "remoting/client/software_video_renderer.h" | 19 #include "remoting/client/software_video_renderer.h" |
| 20 #include "remoting/client/token_fetcher_proxy.h" | 20 #include "remoting/client/token_fetcher_proxy.h" |
| 21 #include "remoting/protocol/chromium_port_allocator.h" | 21 #include "remoting/protocol/chromium_port_allocator.h" |
| 22 #include "remoting/protocol/chromium_socket_factory.h" | 22 #include "remoting/protocol/chromium_socket_factory.h" |
| 23 #include "remoting/protocol/host_stub.h" | 23 #include "remoting/protocol/host_stub.h" |
| 24 #include "remoting/protocol/libjingle_transport_factory.h" | 24 #include "remoting/protocol/ice_transport_factory.h" |
| 25 #include "remoting/protocol/negotiating_client_authenticator.h" | 25 #include "remoting/protocol/negotiating_client_authenticator.h" |
| 26 #include "remoting/protocol/network_settings.h" | 26 #include "remoting/protocol/network_settings.h" |
| 27 #include "remoting/protocol/performance_tracker.h" | 27 #include "remoting/protocol/performance_tracker.h" |
| 28 #include "remoting/signaling/server_log_entry.h" | 28 #include "remoting/signaling/server_log_entry.h" |
| 29 #include "ui/events/keycodes/dom/keycode_converter.h" | 29 #include "ui/events/keycodes/dom/keycode_converter.h" |
| 30 | 30 |
| 31 namespace remoting { | 31 namespace remoting { |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 | 409 |
| 410 protocol::NetworkSettings network_settings( | 410 protocol::NetworkSettings network_settings( |
| 411 protocol::NetworkSettings::NAT_TRAVERSAL_FULL); | 411 protocol::NetworkSettings::NAT_TRAVERSAL_FULL); |
| 412 | 412 |
| 413 // Use Chrome's network stack to allocate ports for peer-to-peer channels. | 413 // Use Chrome's network stack to allocate ports for peer-to-peer channels. |
| 414 scoped_ptr<protocol::ChromiumPortAllocator> port_allocator( | 414 scoped_ptr<protocol::ChromiumPortAllocator> port_allocator( |
| 415 protocol::ChromiumPortAllocator::Create(jni_runtime_->url_requester(), | 415 protocol::ChromiumPortAllocator::Create(jni_runtime_->url_requester(), |
| 416 network_settings)); | 416 network_settings)); |
| 417 | 417 |
| 418 scoped_ptr<protocol::TransportFactory> transport_factory( | 418 scoped_ptr<protocol::TransportFactory> transport_factory( |
| 419 new protocol::LibjingleTransportFactory( | 419 new protocol::IceTransportFactory( |
| 420 signaling_.get(), port_allocator.Pass(), network_settings, | 420 signaling_.get(), port_allocator.Pass(), network_settings, |
| 421 protocol::TransportRole::CLIENT)); | 421 protocol::TransportRole::CLIENT)); |
| 422 | 422 |
| 423 client_->Start(signaling_.get(), authenticator_.Pass(), | 423 client_->Start(signaling_.get(), authenticator_.Pass(), |
| 424 transport_factory.Pass(), host_jid_, capabilities_); | 424 transport_factory.Pass(), host_jid_, capabilities_); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void ChromotingJniInstance::FetchSecret( | 427 void ChromotingJniInstance::FetchSecret( |
| 428 bool pairable, | 428 bool pairable, |
| 429 const protocol::SecretFetchedCallback& callback) { | 429 const protocol::SecretFetchedCallback& callback) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 perf_tracker_->round_trip_ms()); | 494 perf_tracker_->round_trip_ms()); |
| 495 | 495 |
| 496 client_status_logger_->LogStatistics(perf_tracker_.get()); | 496 client_status_logger_->LogStatistics(perf_tracker_.get()); |
| 497 | 497 |
| 498 jni_runtime_->network_task_runner()->PostDelayedTask( | 498 jni_runtime_->network_task_runner()->PostDelayedTask( |
| 499 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), | 499 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), |
| 500 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 500 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
| 501 } | 501 } |
| 502 | 502 |
| 503 } // namespace remoting | 503 } // namespace remoting |
| OLD | NEW |