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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/SessionConnector.java

Issue 1537183002: Refactor Chromoting JNI code to use jni/Client (Java changes only). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/android/java/src/org/chromium/chromoting/SessionConnector.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java b/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java
index 5bb53f548ddf4f69cd1d9a8f59193bcaff2cfc35..9c670aded4ee6b5559919945489df14d52422c79 100644
--- a/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java
+++ b/remoting/android/java/src/org/chromium/chromoting/SessionConnector.java
@@ -4,15 +4,15 @@
package org.chromium.chromoting;
+import org.chromium.chromoting.jni.Client;
import org.chromium.chromoting.jni.ConnectionListener;
-import org.chromium.chromoting.jni.JniInterface;
/**
* This class manages making a connection to a host, with logic for reloading the host list and
* retrying the connection in the case of a stale host JID.
*/
-public class SessionConnector implements ConnectionListener,
- HostListLoader.Callback {
+public class SessionConnector implements ConnectionListener, HostListLoader.Callback {
+ private Client mClient;
private ConnectionListener mConnectionCallback;
private HostListLoader.Callback mHostListCallback;
private HostListLoader mHostListLoader;
@@ -37,8 +37,9 @@ public class SessionConnector implements ConnectionListener,
* @param hostListCallback Object to be notified whenever the host list is reloaded.
* @param hostListLoader The object used for reloading the host list.
*/
- public SessionConnector(ConnectionListener connectionCallback,
+ public SessionConnector(Client client, ConnectionListener connectionCallback,
HostListLoader.Callback hostListCallback, HostListLoader hostListLoader) {
+ mClient = client;
mConnectionCallback = connectionCallback;
mHostListCallback = hostListCallback;
mHostListLoader = hostListLoader;
@@ -60,7 +61,7 @@ public class SessionConnector implements ConnectionListener,
return;
}
- JniInterface.connectToHost(accountName, authToken, host.jabberId, host.id, host.publicKey,
+ mClient.connectToHost(accountName, authToken, host.jabberId, host.id, host.publicKey,
this, mAuthenticator);
}
@@ -110,7 +111,7 @@ public class SessionConnector implements ConnectionListener,
} else {
// Reconnect to the host, but use the original callback directly, instead of this
// wrapper object, so the host list is not loaded again.
- JniInterface.connectToHost(mAccountName, mAuthToken, foundHost.jabberId,
+ mClient.connectToHost(mAccountName, mAuthToken, foundHost.jabberId,
foundHost.id, foundHost.publicKey, mConnectionCallback, mAuthenticator);
}
}

Powered by Google App Engine
This is Rietveld 408576698