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

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

Issue 2753963002: Refactoring and rewriting the chromoting jni instance to be chromoting session. (Closed)
Patch Set: WeakPtr Factory now makes type ChromotingClientRuntime::Delegate. 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_runtime_delegate.cc
diff --git a/remoting/client/jni/jni_runtime_delegate.cc b/remoting/client/jni/jni_runtime_delegate.cc
index 095db0b03931335146daba12b6d6bd6fbeb1456d..35ddc8c4dca95eb61b939e3169e0ea040f3adf60 100644
--- a/remoting/client/jni/jni_runtime_delegate.cc
+++ b/remoting/client/jni/jni_runtime_delegate.cc
@@ -68,7 +68,7 @@ JniRuntimeDelegate* JniRuntimeDelegate::GetInstance() {
return base::Singleton<JniRuntimeDelegate>::get();
}
-JniRuntimeDelegate::JniRuntimeDelegate() {
+JniRuntimeDelegate::JniRuntimeDelegate() : weak_factory_(this) {
runtime_ = ChromotingClientRuntime::GetInstance();
}
@@ -76,6 +76,11 @@ JniRuntimeDelegate::~JniRuntimeDelegate() {
runtime_ = nullptr;
}
+base::WeakPtr<ChromotingClientRuntime::Delegate>
+JniRuntimeDelegate::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
void JniRuntimeDelegate::RuntimeWillShutdown() {
DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread());

Powered by Google App Engine
This is Rietveld 408576698