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

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

Issue 21554002: Enable Android support for Chromoting PINless (paired) authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Prevent future coordinates-related bugs Created 7 years, 4 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/chromoting_jni_instance.h
diff --git a/remoting/client/jni/chromoting_jni_instance.h b/remoting/client/jni/chromoting_jni_instance.h
index d6c7dbc5e1f381dca801b9e84c3f4279faba082f..a8684bf4b82204e12436d64df7979596d4600793 100644
--- a/remoting/client/jni/chromoting_jni_instance.h
+++ b/remoting/client/jni/chromoting_jni_instance.h
@@ -37,13 +37,16 @@ class ChromotingJniInstance
public base::RefCountedThreadSafe<ChromotingJniInstance> {
public:
// Initiates a connection with the specified host. Call from the UI thread.
- // The instance does not take ownership of |jni_runtime|.
+ // The instance does not take ownership of |jni_runtime|. To connect with an
+ // unpaired host, pass in |pairing_id| and |pairing_secret| as empty strings.
ChromotingJniInstance(ChromotingJniRuntime* jni_runtime,
const char* username,
const char* auth_token,
const char* host_jid,
const char* host_id,
- const char* host_pubkey);
+ const char* host_pubkey,
+ const char* pairing_id,
+ const char* pairing_secret);
// Terminates the current connection (if it hasn't already failed) and cleans
// up. Must be called before destruction.
@@ -52,7 +55,7 @@ class ChromotingJniInstance
// 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()).
- void ProvideSecret(const std::string& pin);
+ void ProvideSecret(const std::string& pin, bool create_pair);
// Schedules a redraw on the display thread. May be called from any thread.
void RedrawDesktop();
@@ -131,6 +134,14 @@ class ChromotingJniInstance
std::string host_jid_;
std::string host_id_;
std::string host_pubkey_;
+ std::string pairing_id_;
+ std::string pairing_secret_;
+
+ // Indicates whether to establish a new pairing with this host. This is
+ // modified in ProvideSecret(), but thereafter to be used only from the
+ // network thread. (This is safe because ProvideSecret() is invoked at most
+ // once per run, and always before any reference to this flag.)
+ bool create_pairing_;
friend class base::RefCountedThreadSafe<ChromotingJniInstance>;

Powered by Google App Engine
This is Rietveld 408576698