| 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 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 scoped_refptr<protocol::TransportContext> transport_context = | 401 scoped_refptr<protocol::TransportContext> transport_context = |
| 402 new protocol::TransportContext( | 402 new protocol::TransportContext( |
| 403 signaling_.get(), | 403 signaling_.get(), |
| 404 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()), | 404 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()), |
| 405 make_scoped_ptr( | 405 make_scoped_ptr( |
| 406 new ChromiumUrlRequestFactory(jni_runtime_->url_requester())), | 406 new ChromiumUrlRequestFactory(jni_runtime_->url_requester())), |
| 407 protocol::NetworkSettings( | 407 protocol::NetworkSettings( |
| 408 protocol::NetworkSettings::NAT_TRAVERSAL_FULL), | 408 protocol::NetworkSettings::NAT_TRAVERSAL_FULL), |
| 409 protocol::TransportRole::CLIENT); | 409 protocol::TransportRole::CLIENT); |
| 410 | 410 |
| 411 #if defined(ENABLE_WEBRTC_REMOTING_CLIENT) |
| 411 if (flags_.find("useWebrtc") != std::string::npos) { | 412 if (flags_.find("useWebrtc") != std::string::npos) { |
| 412 VLOG(0) << "Attempting to connect using WebRTC."; | 413 VLOG(0) << "Attempting to connect using WebRTC."; |
| 413 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = | 414 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = |
| 414 protocol::CandidateSessionConfig::CreateEmpty(); | 415 protocol::CandidateSessionConfig::CreateEmpty(); |
| 415 protocol_config->set_webrtc_supported(true); | 416 protocol_config->set_webrtc_supported(true); |
| 416 protocol_config->set_ice_supported(false); | 417 protocol_config->set_ice_supported(false); |
| 417 client_->set_protocol_config(std::move(protocol_config)); | 418 client_->set_protocol_config(std::move(protocol_config)); |
| 418 } | 419 } |
| 419 | 420 #endif // defined(ENABLE_WEBRTC_REMOTING_CLIENT) |
| 420 client_->Start(signaling_.get(), client_auth_config_, transport_context, | 421 client_->Start(signaling_.get(), client_auth_config_, transport_context, |
| 421 host_jid_, capabilities_); | 422 host_jid_, capabilities_); |
| 422 } | 423 } |
| 423 | 424 |
| 424 void ChromotingJniInstance::FetchSecret( | 425 void ChromotingJniInstance::FetchSecret( |
| 425 bool pairable, | 426 bool pairable, |
| 426 const protocol::SecretFetchedCallback& callback) { | 427 const protocol::SecretFetchedCallback& callback) { |
| 427 if (!jni_runtime_->ui_task_runner()->BelongsToCurrentThread()) { | 428 if (!jni_runtime_->ui_task_runner()->BelongsToCurrentThread()) { |
| 428 jni_runtime_->ui_task_runner()->PostTask( | 429 jni_runtime_->ui_task_runner()->PostTask( |
| 429 FROM_HERE, base::Bind(&ChromotingJniInstance::FetchSecret, | 430 FROM_HERE, base::Bind(&ChromotingJniInstance::FetchSecret, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 perf_tracker_->round_trip_ms()); | 492 perf_tracker_->round_trip_ms()); |
| 492 | 493 |
| 493 client_status_logger_->LogStatistics(perf_tracker_.get()); | 494 client_status_logger_->LogStatistics(perf_tracker_.get()); |
| 494 | 495 |
| 495 jni_runtime_->network_task_runner()->PostDelayedTask( | 496 jni_runtime_->network_task_runner()->PostDelayedTask( |
| 496 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), | 497 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), |
| 497 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 498 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
| 498 } | 499 } |
| 499 | 500 |
| 500 } // namespace remoting | 501 } // namespace remoting |
| OLD | NEW |