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

Side by Side Diff: remoting/client/jni/chromoting_jni_runtime.cc

Issue 407403002: Chromoting: Synchronize connected/disconnected state between Java/C++ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/jni/chromoting_jni_runtime.h" 5 #include "remoting/client/jni/chromoting_jni_runtime.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 229
230 void ChromotingJniRuntime::DisconnectFromHost() { 230 void ChromotingJniRuntime::DisconnectFromHost() {
231 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 231 DCHECK(ui_task_runner_->BelongsToCurrentThread());
232 if (session_) { 232 if (session_) {
233 session_->Disconnect(); 233 session_->Disconnect();
234 session_ = NULL; 234 session_ = NULL;
235 } 235 }
236 } 236 }
237 237
238 void ChromotingJniRuntime::ReportConnectionStatus( 238 void ChromotingJniRuntime::OnConnectionState(
239 protocol::ConnectionToHost::State state, 239 protocol::ConnectionToHost::State state,
240 protocol::ErrorCode error) { 240 protocol::ErrorCode error) {
241 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 241 DCHECK(ui_task_runner_->BelongsToCurrentThread());
242 242
243 JNIEnv* env = base::android::AttachCurrentThread(); 243 JNIEnv* env = base::android::AttachCurrentThread();
244 Java_JniInterface_reportConnectionStatus(env, state, error); 244 Java_JniInterface_onConnectionState(env, state, error);
245 } 245 }
246 246
247 void ChromotingJniRuntime::DisplayAuthenticationPrompt(bool pairing_supported) { 247 void ChromotingJniRuntime::DisplayAuthenticationPrompt(bool pairing_supported) {
248 DCHECK(ui_task_runner_->BelongsToCurrentThread()); 248 DCHECK(ui_task_runner_->BelongsToCurrentThread());
249 249
250 JNIEnv* env = base::android::AttachCurrentThread(); 250 JNIEnv* env = base::android::AttachCurrentThread();
251 Java_JniInterface_displayAuthenticationPrompt(env, pairing_supported); 251 Java_JniInterface_displayAuthenticationPrompt(env, pairing_supported);
252 } 252 }
253 253
254 void ChromotingJniRuntime::CommitPairingCredentials(const std::string& host, 254 void ChromotingJniRuntime::CommitPairingCredentials(const std::string& host,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 JNIEnv* env = base::android::AttachCurrentThread(); 323 JNIEnv* env = base::android::AttachCurrentThread();
324 Java_JniInterface_redrawGraphicsInternal(env); 324 Java_JniInterface_redrawGraphicsInternal(env);
325 } 325 }
326 326
327 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { 327 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) {
328 base::android::DetachFromVM(); 328 base::android::DetachFromVM();
329 waiter->Signal(); 329 waiter->Signal();
330 } 330 }
331 } // namespace remoting 331 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698