| 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/library_loader/library_loader_hooks.h" | 10 #include "base/android/library_loader/library_loader_hooks.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 bool RegisterChromotingJniRuntime(JNIEnv* env) { | 33 bool RegisterChromotingJniRuntime(JNIEnv* env) { |
| 34 return remoting::RegisterNativesImpl(env); | 34 return remoting::RegisterNativesImpl(env); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Implementation of stubs defined in JniInterface_jni.h. These are the entry | 37 // Implementation of stubs defined in JniInterface_jni.h. These are the entry |
| 38 // points for JNI calls from Java into C++. | 38 // points for JNI calls from Java into C++. |
| 39 | 39 |
| 40 static void LoadNative(JNIEnv* env, | 40 static void LoadNative(JNIEnv* env, |
| 41 const JavaParamRef<jclass>& clazz, | 41 const JavaParamRef<jclass>& clazz, |
| 42 const JavaParamRef<jobject>& context) { | 42 const JavaParamRef<jobject>& context) { |
| 43 base::android::ScopedJavaLocalRef<jobject> context_activity(env, context); | 43 base::android::InitApplicationContext(env, context); |
| 44 base::android::InitApplicationContext(env, context_activity); | |
| 45 | 44 |
| 46 // The google_apis functions check the command-line arguments to make sure no | 45 // The google_apis functions check the command-line arguments to make sure no |
| 47 // runtime API keys have been specified by the environment. Unfortunately, we | 46 // runtime API keys have been specified by the environment. Unfortunately, we |
| 48 // neither launch Chromium nor have a command line, so we need to prevent | 47 // neither launch Chromium nor have a command line, so we need to prevent |
| 49 // them from DCHECKing out when they go looking. | 48 // them from DCHECKing out when they go looking. |
| 50 base::CommandLine::Init(0, nullptr); | 49 base::CommandLine::Init(0, nullptr); |
| 51 | 50 |
| 52 // Create the singleton now so that the Chromoting threads will be set up. | 51 // Create the singleton now so that the Chromoting threads will be set up. |
| 53 remoting::ChromotingJniRuntime::GetInstance(); | 52 remoting::ChromotingJniRuntime::GetInstance(); |
| 54 } | 53 } |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 366 |
| 368 JNIEnv* env = base::android::AttachCurrentThread(); | 367 JNIEnv* env = base::android::AttachCurrentThread(); |
| 369 Java_JniInterface_redrawGraphicsInternal(env); | 368 Java_JniInterface_redrawGraphicsInternal(env); |
| 370 } | 369 } |
| 371 | 370 |
| 372 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { | 371 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { |
| 373 base::android::DetachFromVM(); | 372 base::android::DetachFromVM(); |
| 374 waiter->Signal(); | 373 waiter->Signal(); |
| 375 } | 374 } |
| 376 } // namespace remoting | 375 } // namespace remoting |
| OLD | NEW |