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

Side by Side Diff: webrtc/modules/utility/source/jvm_android.cc

Issue 1229443002: Use strcmp instead of == operator for c.name and name to find appropriate classes for WebRtcAudio*.… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add space after comma in strcmp Created 5 years, 5 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
« no previous file with comments | « no previous file | 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 /* 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698