| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 xmpp_config_.username = username; | 73 xmpp_config_.username = username; |
| 74 xmpp_config_.auth_token = auth_token; | 74 xmpp_config_.auth_token = auth_token; |
| 75 | 75 |
| 76 // Initialize |authenticator_|. | 76 // Initialize |authenticator_|. |
| 77 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> | 77 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> |
| 78 token_fetcher(new TokenFetcherProxy( | 78 token_fetcher(new TokenFetcherProxy( |
| 79 base::Bind(&ChromotingJniInstance::FetchThirdPartyToken, | 79 base::Bind(&ChromotingJniInstance::FetchThirdPartyToken, |
| 80 weak_factory_.GetWeakPtr()), | 80 weak_factory_.GetWeakPtr()), |
| 81 host_pubkey)); | 81 host_pubkey)); |
| 82 | 82 |
| 83 std::vector<protocol::AuthenticationMethod> auth_methods; | |
| 84 auth_methods.push_back(protocol::AuthenticationMethod::THIRD_PARTY); | |
| 85 auth_methods.push_back(protocol::AuthenticationMethod::SPAKE2_PAIR); | |
| 86 auth_methods.push_back( | |
| 87 protocol::AuthenticationMethod::SPAKE2_SHARED_SECRET_HMAC); | |
| 88 auth_methods.push_back( | |
| 89 protocol::AuthenticationMethod::SPAKE2_SHARED_SECRET_PLAIN); | |
| 90 | |
| 91 authenticator_.reset(new protocol::NegotiatingClientAuthenticator( | 83 authenticator_.reset(new protocol::NegotiatingClientAuthenticator( |
| 92 pairing_id, pairing_secret, host_id_, | 84 pairing_id, pairing_secret, host_id_, |
| 93 base::Bind(&ChromotingJniInstance::FetchSecret, this), | 85 base::Bind(&ChromotingJniInstance::FetchSecret, this), |
| 94 std::move(token_fetcher), auth_methods)); | 86 std::move(token_fetcher))); |
| 95 | 87 |
| 96 // Post a task to start connection | 88 // Post a task to start connection |
| 97 jni_runtime_->network_task_runner()->PostTask( | 89 jni_runtime_->network_task_runner()->PostTask( |
| 98 FROM_HERE, | 90 FROM_HERE, |
| 99 base::Bind(&ChromotingJniInstance::ConnectToHostOnNetworkThread, this)); | 91 base::Bind(&ChromotingJniInstance::ConnectToHostOnNetworkThread, this)); |
| 100 } | 92 } |
| 101 | 93 |
| 102 ChromotingJniInstance::~ChromotingJniInstance() { | 94 ChromotingJniInstance::~ChromotingJniInstance() { |
| 103 // This object is ref-counted, so this dtor can execute on any thread. | 95 // This object is ref-counted, so this dtor can execute on any thread. |
| 104 // Ensure that all these objects have been freed already, so they are not | 96 // Ensure that all these objects have been freed already, so they are not |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 perf_tracker_->round_trip_ms()); | 510 perf_tracker_->round_trip_ms()); |
| 519 | 511 |
| 520 client_status_logger_->LogStatistics(perf_tracker_.get()); | 512 client_status_logger_->LogStatistics(perf_tracker_.get()); |
| 521 | 513 |
| 522 jni_runtime_->network_task_runner()->PostDelayedTask( | 514 jni_runtime_->network_task_runner()->PostDelayedTask( |
| 523 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), | 515 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), |
| 524 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 516 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
| 525 } | 517 } |
| 526 | 518 |
| 527 } // namespace remoting | 519 } // namespace remoting |
| OLD | NEW |