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

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

Issue 2745583008: Refactoring out the chromoting jni runtime class in favor of chromoting client runtime. (Closed)
Patch Set: Missed out on a () Created 3 years, 9 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.cc
diff --git a/remoting/client/jni/jni_pairing_secret_fetcher.cc b/remoting/client/jni/jni_pairing_secret_fetcher.cc
index 39a36520e13e261c40032a5c589f69e6adb4c16c..cccd857659a1e3281a4a27a3308ba3d98eea9742 100644
--- a/remoting/client/jni/jni_pairing_secret_fetcher.cc
+++ b/remoting/client/jni/jni_pairing_secret_fetcher.cc
@@ -5,39 +5,36 @@
#include "remoting/client/jni/jni_pairing_secret_fetcher.h"
#include "base/bind.h"
#include "base/location.h"
-#include "remoting/client/jni/chromoting_jni_runtime.h"
+#include "remoting/client/chromoting_client_runtime.h"
#include "remoting/client/jni/jni_client.h"
namespace remoting {
-JniPairingSecretFetcher::JniPairingSecretFetcher(ChromotingJniRuntime* runtime,
- base::WeakPtr<JniClient> client,
- const std::string& host_id) :
- jni_runtime_(runtime),
- jni_client_(client),
- host_id_(host_id),
- weak_factory_(this) {
+JniPairingSecretFetcher::JniPairingSecretFetcher(
+ base::WeakPtr<JniClient> client,
+ const std::string& host_id)
+ : jni_client_(client), host_id_(host_id), weak_factory_(this) {
+ runtime_ = ChromotingClientRuntime::GetInstance();
weak_ptr_ = weak_factory_.GetWeakPtr();
}
JniPairingSecretFetcher::~JniPairingSecretFetcher() {
- DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread());
+ DCHECK(runtime_->network_task_runner()->BelongsToCurrentThread());
}
void JniPairingSecretFetcher::FetchSecret(
bool pairable,
const protocol::SecretFetchedCallback& callback) {
- DCHECK (jni_runtime_->network_task_runner()->BelongsToCurrentThread());
+ DCHECK(runtime_->network_task_runner()->BelongsToCurrentThread());
callback_ = callback;
- jni_runtime_->ui_task_runner()->PostTask(
- FROM_HERE,
- base::Bind(&JniPairingSecretFetcher::FetchSecretOnUiThread, jni_client_,
- host_id_, pairable));
+ runtime_->ui_task_runner()->PostTask(
+ FROM_HERE, base::Bind(&JniPairingSecretFetcher::FetchSecretOnUiThread,
+ jni_client_, host_id_, pairable));
}
void JniPairingSecretFetcher::ProvideSecret(const std::string& pin) {
- DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread());
+ DCHECK(runtime_->network_task_runner()->BelongsToCurrentThread());
DCHECK(!callback_.is_null());
callback_.Run(pin);

Powered by Google App Engine
This is Rietveld 408576698