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

Unified Diff: talk/app/webrtc/java/jni/jni_onload.cc

Issue 1511633002: Add APK targets to build libjingle tests for Android. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/java/jni/peerconnection_jni.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/jni/jni_onload.cc
diff --git a/talk/app/webrtc/objc/RTCPeerConnectionFactory+Internal.h b/talk/app/webrtc/java/jni/jni_onload.cc
similarity index 65%
copy from talk/app/webrtc/objc/RTCPeerConnectionFactory+Internal.h
copy to talk/app/webrtc/java/jni/jni_onload.cc
index 5d6fa12711a1515d3183208bd415bf3c11120c6c..9664ecdca6b2020f05fc9ca08a82638debb88e7f 100644
--- a/talk/app/webrtc/objc/RTCPeerConnectionFactory+Internal.h
+++ b/talk/app/webrtc/java/jni/jni_onload.cc
@@ -25,14 +25,31 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "RTCPeerConnectionFactory.h"
+#include <jni.h>
+#undef JNIEXPORT
+#define JNIEXPORT __attribute__((visibility("default")))
-#include "talk/app/webrtc/peerconnectionfactory.h"
-#include "webrtc/base/scoped_ptr.h"
+#include "talk/app/webrtc/java/jni/classreferenceholder.h"
+#include "talk/app/webrtc/java/jni/jni_helpers.h"
+#include "webrtc/base/ssladapter.h"
-@interface RTCPeerConnectionFactory ()
+namespace webrtc_jni {
-@property(nonatomic, assign) rtc::scoped_refptr<
- webrtc::PeerConnectionFactoryInterface> nativeFactory;
+extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
+ jint ret = InitGlobalJniVariables(jvm);
+ RTC_DCHECK_GE(ret, 0);
+ if (ret < 0)
+ return -1;
-@end
+ RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()";
+ LoadGlobalClassReferenceHolder();
+
+ return ret;
+}
+
+extern "C" void JNIEXPORT JNICALL JNI_OnUnLoad(JavaVM *jvm, void *reserved) {
+ FreeGlobalClassReferenceHolder();
+ RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()";
+}
+
+} // namespace webrtc_jni
« no previous file with comments | « no previous file | talk/app/webrtc/java/jni/peerconnection_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698