| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 #include "webrtc/api/java/jni/classreferenceholder.h" | 10 #include "webrtc/api/java/jni/classreferenceholder.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 LoadClass(jni, "org/webrtc/PeerConnection$TcpCandidatePolicy"); | 83 LoadClass(jni, "org/webrtc/PeerConnection$TcpCandidatePolicy"); |
| 84 LoadClass(jni, "org/webrtc/PeerConnection$KeyType"); | 84 LoadClass(jni, "org/webrtc/PeerConnection$KeyType"); |
| 85 LoadClass(jni, "org/webrtc/PeerConnection$SignalingState"); | 85 LoadClass(jni, "org/webrtc/PeerConnection$SignalingState"); |
| 86 LoadClass(jni, "org/webrtc/RtpReceiver"); | 86 LoadClass(jni, "org/webrtc/RtpReceiver"); |
| 87 LoadClass(jni, "org/webrtc/RtpSender"); | 87 LoadClass(jni, "org/webrtc/RtpSender"); |
| 88 LoadClass(jni, "org/webrtc/SessionDescription"); | 88 LoadClass(jni, "org/webrtc/SessionDescription"); |
| 89 LoadClass(jni, "org/webrtc/SessionDescription$Type"); | 89 LoadClass(jni, "org/webrtc/SessionDescription$Type"); |
| 90 LoadClass(jni, "org/webrtc/StatsReport"); | 90 LoadClass(jni, "org/webrtc/StatsReport"); |
| 91 LoadClass(jni, "org/webrtc/StatsReport$Value"); | 91 LoadClass(jni, "org/webrtc/StatsReport$Value"); |
| 92 LoadClass(jni, "org/webrtc/SurfaceTextureHelper"); | 92 LoadClass(jni, "org/webrtc/SurfaceTextureHelper"); |
| 93 LoadClass(jni, "org/webrtc/VideoCapturerAndroid"); | 93 LoadClass(jni, "org/webrtc/VideoCapturer"); |
| 94 LoadClass(jni, "org/webrtc/VideoCapturerAndroid$NativeObserver"); | 94 LoadClass(jni, "org/webrtc/VideoCapturer$NativeObserver"); |
| 95 LoadClass(jni, "org/webrtc/VideoRenderer$I420Frame"); | 95 LoadClass(jni, "org/webrtc/VideoRenderer$I420Frame"); |
| 96 LoadClass(jni, "org/webrtc/VideoTrack"); | 96 LoadClass(jni, "org/webrtc/VideoTrack"); |
| 97 } | 97 } |
| 98 | 98 |
| 99 ClassReferenceHolder::~ClassReferenceHolder() { | 99 ClassReferenceHolder::~ClassReferenceHolder() { |
| 100 RTC_CHECK(classes_.empty()) << "Must call FreeReferences() before dtor!"; | 100 RTC_CHECK(classes_.empty()) << "Must call FreeReferences() before dtor!"; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void ClassReferenceHolder::FreeReferences(JNIEnv* jni) { | 103 void ClassReferenceHolder::FreeReferences(JNIEnv* jni) { |
| 104 for (std::map<std::string, jclass>::const_iterator it = classes_.begin(); | 104 for (std::map<std::string, jclass>::const_iterator it = classes_.begin(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 125 RTC_CHECK(inserted) << "Duplicate class name: " << name; | 125 RTC_CHECK(inserted) << "Duplicate class name: " << name; |
| 126 } | 126 } |
| 127 | 127 |
| 128 // Returns a global reference guaranteed to be valid for the lifetime of the | 128 // Returns a global reference guaranteed to be valid for the lifetime of the |
| 129 // process. | 129 // process. |
| 130 jclass FindClass(JNIEnv* jni, const char* name) { | 130 jclass FindClass(JNIEnv* jni, const char* name) { |
| 131 return g_class_reference_holder->GetClass(name); | 131 return g_class_reference_holder->GetClass(name); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace webrtc_jni | 134 } // namespace webrtc_jni |
| OLD | NEW |