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

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

Issue 2643483003: [Remoting Android] Refactor ClientTelemetryLogger (Closed)
Patch Set: PTAL Created 3 years, 11 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
« remoting/client/jni/jni_client.h ('K') | « remoting/client/jni/jni_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/jni_client.cc
diff --git a/remoting/client/jni/jni_client.cc b/remoting/client/jni/jni_client.cc
index aaa03b71788bb4b675c1137db4e14e95a86745bb..56c00ee35110436db7db576f8e8138e129be7f09 100644
--- a/remoting/client/jni/jni_client.cc
+++ b/remoting/client/jni/jni_client.cc
@@ -38,25 +38,14 @@ JniClient::~JniClient() {
DisconnectFromHost();
}
-void JniClient::ConnectToHost(const std::string& username,
- const std::string& auth_token,
- const std::string& host_jid,
- const std::string& host_id,
- const std::string& host_pubkey,
- const std::string& pairing_id,
- const std::string& pairing_secret,
- const std::string& capabilities,
- const std::string& flags,
- const std::string& host_version,
- const std::string& host_os,
- const std::string& host_os_version) {
+void JniClient::ConnectToHost(const ConnectToHostInfo& info) {
DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread());
DCHECK(!display_handler_);
DCHECK(!session_);
DCHECK(!secret_fetcher_);
display_handler_.reset(new JniGlDisplayHandler(runtime_, java_client_));
secret_fetcher_.reset(new JniPairingSecretFetcher(runtime_, GetWeakPtr(),
- host_id));
+ info.host_id));
// TODO(BUG 680752): Create ClientTelemetryLogger here. No need to pass host
Sergey Ulanov 2017/01/19 00:50:38 Do we still need this TODO?
Yuwei 2017/01/19 23:00:00 No. Removed. This is not feasible unless we allow
// info all the way down. Currently we have to do that due to thread
// restriction.
@@ -64,9 +53,7 @@ void JniClient::ConnectToHost(const std::string& username,
runtime_, GetWeakPtr(), secret_fetcher_->GetWeakPtr(),
display_handler_->CreateCursorShapeStub(),
display_handler_->CreateVideoRenderer(),
- username, auth_token, host_jid, host_id,
- host_pubkey, pairing_id, pairing_secret, capabilities, flags,
- host_version, host_os, host_os_version));
+ info));
Sergey Ulanov 2017/01/19 00:50:38 git cl format
Yuwei 2017/01/19 23:00:00 Done.
session_->Connect();
}
@@ -169,18 +156,20 @@ void JniClient::Connect(
const base::android::JavaParamRef<jstring>& host_version,
const base::android::JavaParamRef<jstring>& host_os,
const base::android::JavaParamRef<jstring>& host_os_version) {
Sergey Ulanov 2017/01/19 00:50:38 This list of parameters could be cleaned up on the
Yuwei 2017/01/19 23:00:00 Done.
- ConnectToHost(ConvertJavaStringToUTF8(env, username),
- ConvertJavaStringToUTF8(env, authToken),
- ConvertJavaStringToUTF8(env, hostJid),
- ConvertJavaStringToUTF8(env, hostId),
- ConvertJavaStringToUTF8(env, hostPubkey),
- ConvertJavaStringToUTF8(env, pairId),
- ConvertJavaStringToUTF8(env, pairSecret),
- ConvertJavaStringToUTF8(env, capabilities),
- ConvertJavaStringToUTF8(env, flags),
- ConvertJavaStringToUTF8(env, host_version),
- ConvertJavaStringToUTF8(env, host_os),
- ConvertJavaStringToUTF8(env, host_os_version));
+ ConnectToHostInfo info;
+ info.username = ConvertJavaStringToUTF8(env, username);
+ info.auth_token = ConvertJavaStringToUTF8(env, authToken);
+ info.host_jid = ConvertJavaStringToUTF8(env, hostJid);
+ info.host_id = ConvertJavaStringToUTF8(env, hostId);
+ info.host_pubkey = ConvertJavaStringToUTF8(env, hostPubkey);
+ info.pairing_id = ConvertJavaStringToUTF8(env, pairId);
+ info.pairing_secret = ConvertJavaStringToUTF8(env, pairSecret);
+ info.capabilities = ConvertJavaStringToUTF8(env, capabilities);
+ info.flags = ConvertJavaStringToUTF8(env, flags);
+ info.host_version = ConvertJavaStringToUTF8(env, host_version);
+ info.host_os = ConvertJavaStringToUTF8(env, host_os);
+ info.host_os_version = ConvertJavaStringToUTF8(env, host_os_version);
+ ConnectToHost(info);
}
void JniClient::Disconnect(JNIEnv* env,
« remoting/client/jni/jni_client.h ('K') | « remoting/client/jni/jni_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698