Chromium Code Reviews| Index: remoting/client/jni/chromoting_jni_instance.cc |
| diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc |
| index 19e789718851148263aea30b98ba7081c8f7a243..3f9bd22fcd15f95336ab9b66c544ee1f3ed08e75 100644 |
| --- a/remoting/client/jni/chromoting_jni_instance.cc |
| +++ b/remoting/client/jni/chromoting_jni_instance.cc |
| @@ -12,6 +12,8 @@ |
| #include "remoting/client/audio_player.h" |
| #include "remoting/client/jni/android_keymap.h" |
| #include "remoting/client/jni/chromoting_jni_runtime.h" |
| +#include "remoting/client/log_to_server.h" |
| +#include "remoting/client/server_log_entry.h" |
| #include "remoting/client/software_video_renderer.h" |
| #include "remoting/jingle_glue/chromium_port_allocator.h" |
| #include "remoting/jingle_glue/chromium_socket_factory.h" |
| @@ -29,7 +31,7 @@ const int kXmppPort = 5222; |
| const bool kXmppUseTls = true; |
| // Interval at which to log performance statistics, if enabled. |
| -const int kPerfStatsIntervalMs = 10000; |
| +const int kPerfStatsIntervalMs = 60000; |
| } |
| @@ -215,6 +217,8 @@ void ChromotingJniInstance::OnConnectionState( |
| EnableStatsLogging(state == protocol::ConnectionToHost::CONNECTED); |
| + log_to_server_->LogSessionStateChange(state, error); |
| + |
| if (create_pairing_ && state == protocol::ConnectionToHost::CONNECTED) { |
| protocol::PairingRequest request; |
| DCHECK(!device_name_.empty()); |
| @@ -332,6 +336,10 @@ void ChromotingJniInstance::ConnectToHostOnNetworkThread() { |
| net::ClientSocketFactory::GetDefaultFactory(), |
| jni_runtime_->url_requester(), xmpp_config_)); |
| + log_to_server_.reset(new client::LogToServer(client::ServerLogEntry::ME2ME, |
| + signaling_.get(), |
| + "remoting@bot.talk.google.com")); |
|
Sergey Ulanov
2014/05/16 22:44:17
Move kDirectoryBotJid from remoting/host/service_u
|
| + |
| NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_FULL); |
| // Use Chrome's network stack to allocate ports for peer-to-peer channels. |
| @@ -358,6 +366,7 @@ void ChromotingJniInstance::DisconnectFromHostOnNetworkThread() { |
| // |client_| must be torn down before |signaling_|. |
| connection_.reset(); |
| client_.reset(); |
| + log_to_server_.reset(); |
| } |
| void ChromotingJniInstance::FetchSecret( |
| @@ -420,6 +429,8 @@ void ChromotingJniInstance::LogPerfStats() { |
| stats->video_paint_ms()->Average(), |
| stats->round_trip_ms()->Average()); |
| + log_to_server_->LogStatistics(stats); |
| + |
| jni_runtime_->network_task_runner()->PostDelayedTask( |
| FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), |
| base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |