OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 void FreeClassReferences(JNIEnv* jni) { | 52 void FreeClassReferences(JNIEnv* jni) { |
53 for (auto& c : loaded_classes) { | 53 for (auto& c : loaded_classes) { |
54 jni->DeleteGlobalRef(c.clazz); | 54 jni->DeleteGlobalRef(c.clazz); |
55 c.clazz = nullptr; | 55 c.clazz = nullptr; |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 jclass LookUpClass(const char* name) { | 59 jclass LookUpClass(const char* name) { |
60 for (auto& c : loaded_classes) { | 60 for (auto& c : loaded_classes) { |
61 if (c.name == name) | 61 if (strcmp(c.name, name) == 0) |
62 return c.clazz; | 62 return c.clazz; |
63 } | 63 } |
64 CHECK(false) << "Unable to find class in lookup table"; | 64 CHECK(false) << "Unable to find class in lookup table"; |
65 return 0; | 65 return 0; |
66 } | 66 } |
67 | 67 |
68 // AttachCurrentThreadIfNeeded implementation. | 68 // AttachCurrentThreadIfNeeded implementation. |
69 AttachCurrentThreadIfNeeded::AttachCurrentThreadIfNeeded() | 69 AttachCurrentThreadIfNeeded::AttachCurrentThreadIfNeeded() |
70 : attached_(false) { | 70 : attached_(false) { |
71 ALOGD("AttachCurrentThreadIfNeeded::ctor%s", GetThreadInfo().c_str()); | 71 ALOGD("AttachCurrentThreadIfNeeded::ctor%s", GetThreadInfo().c_str()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 return rtc::scoped_ptr<JNIEnvironment>(new JNIEnvironment(jni)); | 255 return rtc::scoped_ptr<JNIEnvironment>(new JNIEnvironment(jni)); |
256 } | 256 } |
257 | 257 |
258 JavaClass JVM::GetClass(const char* name) { | 258 JavaClass JVM::GetClass(const char* name) { |
259 ALOGD("JVM::GetClass(%s)%s", name, GetThreadInfo().c_str()); | 259 ALOGD("JVM::GetClass(%s)%s", name, GetThreadInfo().c_str()); |
260 DCHECK(thread_checker_.CalledOnValidThread()); | 260 DCHECK(thread_checker_.CalledOnValidThread()); |
261 return JavaClass(jni(), LookUpClass(name)); | 261 return JavaClass(jni(), LookUpClass(name)); |
262 } | 262 } |
263 | 263 |
264 } // namespace webrtc | 264 } // namespace webrtc |
OLD | NEW |