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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/Chromoting.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/Chromoting.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
index 800be2e323e043b80d7705411ddc1359ec91d527..ef38ec1fa24287c5b5caf643917badea87255dd8 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
@@ -36,6 +36,7 @@ import org.chromium.chromoting.accountswitcher.AccountSwitcher;
import org.chromium.chromoting.accountswitcher.AccountSwitcherFactory;
import org.chromium.chromoting.help.HelpContext;
import org.chromium.chromoting.help.HelpSingleton;
+import org.chromium.chromoting.jni.Client;
import org.chromium.chromoting.jni.ConnectionListener;
import org.chromium.chromoting.jni.JniInterface;
@@ -335,7 +336,7 @@ public class Chromoting extends AppCompatActivity implements ConnectionListener,
@Override
public void onDestroy() {
super.onDestroy();
- JniInterface.disconnectFromHost();
+ JniInterface.destroyClient();
mAccountSwitcher.destroy();
}
@@ -430,6 +431,7 @@ public class Chromoting extends AppCompatActivity implements ConnectionListener,
}
private void connectToHost(HostInfo host) {
+ Client client = JniInterface.createClient();
Sergey Ulanov 2015/12/21 17:58:15 Can this be replaced with "new Client()". The Clie
Lambros 2016/01/29 23:58:25 Done.
mProgressIndicator = ProgressDialog.show(
this,
host.name,
@@ -439,11 +441,11 @@ public class Chromoting extends AppCompatActivity implements ConnectionListener,
new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
- JniInterface.disconnectFromHost();
+ JniInterface.destroyClient();
Sergey Ulanov 2015/12/21 17:58:15 client.destroy()?
Lambros 2016/01/29 23:58:25 Done.
}
});
- SessionConnector connector = new SessionConnector(this, this, mHostListLoader);
- mAuthenticator = new SessionAuthenticator(this, host);
+ SessionConnector connector = new SessionConnector(client, this, this, mHostListLoader);
+ mAuthenticator = new SessionAuthenticator(this, client, host);
connector.connectToHost(mAccount, mToken, host, mAuthenticator);
}

Powered by Google App Engine
This is Rietveld 408576698