| OLD | NEW |
| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 // TODO(solb) Stop pretending to control the managed UI thread's lifetime. | 185 // TODO(solb) Stop pretending to control the managed UI thread's lifetime. |
| 186 ui_task_runner_ = new AutoThreadTaskRunner(ui_loop_->message_loop_proxy(), | 186 ui_task_runner_ = new AutoThreadTaskRunner(ui_loop_->message_loop_proxy(), |
| 187 base::MessageLoop::QuitClosure()); | 187 base::MessageLoop::QuitClosure()); |
| 188 network_task_runner_ = AutoThread::CreateWithType("native_net", | 188 network_task_runner_ = AutoThread::CreateWithType("native_net", |
| 189 ui_task_runner_, | 189 ui_task_runner_, |
| 190 base::MessageLoop::TYPE_IO); | 190 base::MessageLoop::TYPE_IO); |
| 191 display_task_runner_ = AutoThread::Create("native_disp", | 191 display_task_runner_ = AutoThread::Create("native_disp", |
| 192 ui_task_runner_); | 192 ui_task_runner_); |
| 193 | 193 |
| 194 url_requester_ = new URLRequestContextGetter(network_task_runner_); | 194 url_requester_ = |
| 195 new URLRequestContextGetter(network_task_runner_, network_task_runner_); |
| 195 | 196 |
| 196 // Allows later decoding of video frames. | 197 // Allows later decoding of video frames. |
| 197 media::InitializeCPUSpecificYUVConversions(); | 198 media::InitializeCPUSpecificYUVConversions(); |
| 198 } | 199 } |
| 199 | 200 |
| 200 ChromotingJniRuntime::~ChromotingJniRuntime() { | 201 ChromotingJniRuntime::~ChromotingJniRuntime() { |
| 201 // The singleton should only ever be destroyed on the main thread. | 202 // The singleton should only ever be destroyed on the main thread. |
| 202 DCHECK(ui_task_runner_->BelongsToCurrentThread()); | 203 DCHECK(ui_task_runner_->BelongsToCurrentThread()); |
| 203 | 204 |
| 204 // The session must be shut down first, since it depends on our other | 205 // The session must be shut down first, since it depends on our other |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 357 |
| 357 JNIEnv* env = base::android::AttachCurrentThread(); | 358 JNIEnv* env = base::android::AttachCurrentThread(); |
| 358 Java_JniInterface_redrawGraphicsInternal(env); | 359 Java_JniInterface_redrawGraphicsInternal(env); |
| 359 } | 360 } |
| 360 | 361 |
| 361 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { | 362 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { |
| 362 base::android::DetachFromVM(); | 363 base::android::DetachFromVM(); |
| 363 waiter->Signal(); | 364 waiter->Signal(); |
| 364 } | 365 } |
| 365 } // namespace remoting | 366 } // namespace remoting |
| OLD | NEW |