| 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 b24ce20d869ff5f9c7190c2edf3864df62d36e53..6e96c3b6d3ec515857215ae2254e01ef38908cb3 100644
|
| --- a/remoting/client/jni/chromoting_jni_instance.cc
|
| +++ b/remoting/client/jni/chromoting_jni_instance.cc
|
| @@ -83,7 +83,7 @@ ChromotingJniInstance::ChromotingJniInstance(
|
| client_auth_config_.pairing_client_id = pairing_id;
|
| client_auth_config_.pairing_secret = pairing_secret;
|
| client_auth_config_.fetch_secret_callback =
|
| - base::Bind(&ChromotingJniInstance::FetchSecret, GetWeakPtr());
|
| + base::Bind(&JniPairingSecretFetcher::FetchSecret, secret_fetcher);
|
| client_auth_config_.fetch_third_party_token_callback = base::Bind(
|
| &ChromotingJniInstance::FetchThirdPartyToken, GetWeakPtr(), host_pubkey);
|
|
|
| @@ -177,16 +177,14 @@ void ChromotingJniInstance::ProvideSecret(const std::string& pin,
|
| const std::string& device_name) {
|
| DCHECK(jni_runtime_->ui_task_runner()->BelongsToCurrentThread());
|
|
|
| - if (!secret_fetcher_) {
|
| - return;
|
| - }
|
| -
|
| create_pairing_ = create_pairing;
|
|
|
| if (create_pairing)
|
| SetDeviceName(device_name);
|
|
|
| - secret_fetcher_->ProvideSecret(pin);
|
| + jni_runtime_->network_task_runner()->PostTask(
|
| + FROM_HERE, base::Bind(&JniPairingSecretFetcher::ProvideSecret,
|
| + secret_fetcher_, pin));
|
| }
|
|
|
| void ChromotingJniInstance::SendMouseEvent(
|
| @@ -434,18 +432,6 @@ void ChromotingJniInstance::ConnectToHostOnNetworkThread() {
|
| host_jid_, capabilities_);
|
| }
|
|
|
| -void ChromotingJniInstance::FetchSecret(
|
| - bool pairable,
|
| - const protocol::SecretFetchedCallback& callback) {
|
| - if (!jni_runtime_->ui_task_runner()->BelongsToCurrentThread()) {
|
| - jni_runtime_->ui_task_runner()->PostTask(
|
| - FROM_HERE, base::Bind(&JniPairingSecretFetcher::FetchSecret,
|
| - secret_fetcher_, pairable, callback));
|
| - } else if (secret_fetcher_) {
|
| - secret_fetcher_->FetchSecret(pairable, callback);
|
| - }
|
| -}
|
| -
|
| void ChromotingJniInstance::SetDeviceName(const std::string& device_name) {
|
| if (!jni_runtime_->network_task_runner()->BelongsToCurrentThread()) {
|
| jni_runtime_->network_task_runner()->PostTask(
|
|
|