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/client/audio_player.h" | 13 #include "remoting/client/audio_player.h" |
14 #include "remoting/client/jni/android_keymap.h" | 14 #include "remoting/client/jni/android_keymap.h" |
15 #include "remoting/client/jni/chromoting_jni_runtime.h" | 15 #include "remoting/client/jni/chromoting_jni_runtime.h" |
16 #include "remoting/client/log_to_server.h" | 16 #include "remoting/client/log_to_server_client.h" |
17 #include "remoting/client/software_video_renderer.h" | 17 #include "remoting/client/software_video_renderer.h" |
18 #include "remoting/client/token_fetcher_proxy.h" | 18 #include "remoting/client/token_fetcher_proxy.h" |
19 #include "remoting/jingle_glue/chromium_port_allocator.h" | 19 #include "remoting/jingle_glue/chromium_port_allocator.h" |
20 #include "remoting/jingle_glue/chromium_socket_factory.h" | 20 #include "remoting/jingle_glue/chromium_socket_factory.h" |
21 #include "remoting/jingle_glue/network_settings.h" | 21 #include "remoting/jingle_glue/network_settings.h" |
22 #include "remoting/jingle_glue/server_log_entry.h" | 22 #include "remoting/jingle_glue/server_log_entry.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/libjingle_transport_factory.h" |
25 | 25 |
26 namespace remoting { | 26 namespace remoting { |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 client_.reset(new ChromotingClient( | 343 client_.reset(new ChromotingClient( |
344 client_config_, client_context_.get(), connection_.get(), | 344 client_config_, client_context_.get(), connection_.get(), |
345 this, video_renderer_.get(), scoped_ptr<AudioPlayer>())); | 345 this, video_renderer_.get(), scoped_ptr<AudioPlayer>())); |
346 | 346 |
347 | 347 |
348 signaling_.reset(new XmppSignalStrategy( | 348 signaling_.reset(new XmppSignalStrategy( |
349 net::ClientSocketFactory::GetDefaultFactory(), | 349 net::ClientSocketFactory::GetDefaultFactory(), |
350 jni_runtime_->url_requester(), xmpp_config_)); | 350 jni_runtime_->url_requester(), xmpp_config_)); |
351 | 351 |
352 log_to_server_.reset(new client::LogToServer(ServerLogEntry::ME2ME, | 352 log_to_server_.reset(new LogToServerClient(ServerLogEntry::ME2ME, |
353 signaling_.get(), | 353 signaling_.get(), |
354 "remoting@bot.talk.google.com")); | 354 "remoting@bot.talk.google.com")); |
355 | 355 |
356 NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_FULL); | 356 NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_FULL); |
357 | 357 |
358 // Use Chrome's network stack to allocate ports for peer-to-peer channels. | 358 // Use Chrome's network stack to allocate ports for peer-to-peer channels. |
359 scoped_ptr<ChromiumPortAllocator> port_allocator( | 359 scoped_ptr<ChromiumPortAllocator> port_allocator( |
360 ChromiumPortAllocator::Create(jni_runtime_->url_requester(), | 360 ChromiumPortAllocator::Create(jni_runtime_->url_requester(), |
361 network_settings)); | 361 network_settings)); |
362 | 362 |
363 scoped_ptr<protocol::TransportFactory> transport_factory( | 363 scoped_ptr<protocol::TransportFactory> transport_factory( |
364 new protocol::LibjingleTransportFactory( | 364 new protocol::LibjingleTransportFactory( |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 stats->round_trip_ms()->Average()); | 443 stats->round_trip_ms()->Average()); |
444 | 444 |
445 log_to_server_->LogStatistics(stats); | 445 log_to_server_->LogStatistics(stats); |
446 | 446 |
447 jni_runtime_->network_task_runner()->PostDelayedTask( | 447 jni_runtime_->network_task_runner()->PostDelayedTask( |
448 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), | 448 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), |
449 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 449 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
450 } | 450 } |
451 | 451 |
452 } // namespace remoting | 452 } // namespace remoting |
OLD | NEW |