Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: remoting/client/jni/chromoting_jni_instance.cc

Issue 2047613002: [Remoting Android] Move pairing secret fetcher to the network thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's Feedback Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.h ('k') | remoting/client/jni/jni_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.h ('k') | remoting/client/jni/jni_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698