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

Unified Diff: remoting/client/jni/jni_pairing_secret_fetcher.h

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: 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
Index: remoting/client/jni/jni_pairing_secret_fetcher.h
diff --git a/remoting/client/jni/jni_pairing_secret_fetcher.h b/remoting/client/jni/jni_pairing_secret_fetcher.h
index 6b240a90c47bcc3666a140d6d15eacea57bf5ad1..2db001e81d3a887595390d675f8288cb5d80429d 100644
--- a/remoting/client/jni/jni_pairing_secret_fetcher.h
+++ b/remoting/client/jni/jni_pairing_secret_fetcher.h
@@ -14,8 +14,8 @@ namespace remoting {
class ChromotingJniRuntime;
class JniClient;
-// This class fetches the pairing secret on the UI thread. It must be deleted
-// on UI.
+// This class fetches the pairing secret on the UI thread. It is used entirely
+// on the network thread.
Lambros 2016/06/07 01:21:12 Actually, it's created on the UI thread, but there
Yuwei 2016/06/07 18:01:03 Done. Fixed comments.
class JniPairingSecretFetcher {
public:
JniPairingSecretFetcher(ChromotingJniRuntime* runtime,
@@ -23,21 +23,24 @@ class JniPairingSecretFetcher {
const std::string& host_id);
virtual ~JniPairingSecretFetcher();
- // Called on UI thread. Notifies the user interface that the user needs to
- // enter a PIN. The current authentication attempt is put on hold until
- // |callback| is invoked. |callback| will be run on the network thread.
+ // Notifies the user interface that the user needs to enter a PIN. The current
+ // authentication attempt is put on hold until |callback| is invoked.
void FetchSecret(bool pairable,
const protocol::SecretFetchedCallback& callback);
// Provides the user's PIN and resumes the host authentication attempt. Call
- // on the UI thread once the user has finished entering this PIN into the UI,
- // but only after the UI has been asked to provide a PIN (via FetchSecret()).
+ // once the user has finished entering this PIN into the UI, but only after
+ // the UI has been asked to provide a PIN (via FetchSecret()).
void ProvideSecret(const std::string& pin);
// Get weak pointer to be used on the UI thread.
base::WeakPtr<JniPairingSecretFetcher> GetWeakPtr();
Lambros 2016/06/07 01:21:12 Can this be removed?
Yuwei 2016/06/07 17:36:00 Currently JniClient passes in a WeakPtr of the sec
Yuwei 2016/06/07 17:44:26 Hmm... Just thought about this again... The ctor o
private:
+ static void FetchSecretOnUI(base::WeakPtr<JniClient> client,
Lambros 2016/06/07 01:21:12 rename: FetchSecretOnUiThread
Yuwei 2016/06/07 18:01:03 Done.
+ const std::string& host_id,
+ bool pairable);
+
ChromotingJniRuntime* jni_runtime_;
base::WeakPtr<JniClient> jni_client_;

Powered by Google App Engine
This is Rietveld 408576698