Delete useless code.

R=xalep@webrtc.org

Bug: None
Change-Id: I3960184c18f1f6ba26b296f609c823d8b73b3f93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262500
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36984}
This commit is contained in:
Yaowen Guo 2022-05-17 16:10:15 +08:00 committed by WebRTC LUCI CQ
parent 8e87a248de
commit 82cbae4c0d
6 changed files with 7 additions and 73 deletions

View File

@ -868,6 +868,7 @@ if (is_win || is_android) {
deps += [
"../modules/utility",
"../sdk/android:libjingle_peerconnection_jni",
"../sdk/android:native_api_jni",
]
}
}

View File

@ -14,7 +14,7 @@
#include "examples/unityplugin/class_reference_holder.h"
#include "rtc_base/ssl_adapter.h"
#include "sdk/android/src/jni/class_reference_holder.h"
#include "sdk/android/native_api/jni/class_loader.h"
#include "sdk/android/src/jni/jni_helpers.h"
namespace webrtc {
@ -27,14 +27,13 @@ extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM* jvm, void* reserved) {
return -1;
RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()";
LoadGlobalClassReferenceHolder();
webrtc::InitClassLoader(GetEnv());
unity_plugin::LoadGlobalClassReferenceHolder();
return ret;
}
extern "C" void JNIEXPORT JNICALL JNI_OnUnLoad(JavaVM* jvm, void* reserved) {
FreeGlobalClassReferenceHolder();
unity_plugin::FreeGlobalClassReferenceHolder();
RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()";
}

View File

@ -137,6 +137,7 @@ if (is_android) {
deps = [
":libjingle_peerconnection_jni",
":libjingle_peerconnection_metrics_default_jni",
":native_api_jni",
":video_egl_jni",
"../../pc:libjingle_peerconnection",
"../../rtc_base",
@ -563,8 +564,6 @@ if (current_os == "linux" || is_android) {
"src/jni/android_histogram.cc",
"src/jni/android_network_monitor.cc",
"src/jni/android_network_monitor.h",
"src/jni/class_loader.h",
"src/jni/class_reference_holder.h",
"src/jni/jni_common.cc",
"src/jni/jni_helpers.cc",
"src/jni/jni_helpers.h",
@ -1566,6 +1565,7 @@ if (is_android) {
":instrumentationtests_jni",
":libjingle_peerconnection_jni",
":libjingle_peerconnection_metrics_default_jni",
":native_api_jni",
"../../pc:libjingle_peerconnection",
"../../rtc_base",
]

View File

@ -1,24 +0,0 @@
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// Deprecated: use sdk/android/native_api/jni/class_loader.h instead.
#ifndef SDK_ANDROID_SRC_JNI_CLASS_LOADER_H_
#define SDK_ANDROID_SRC_JNI_CLASS_LOADER_H_
#include "sdk/android/native_api/jni/class_loader.h"
namespace webrtc {
namespace jni {
using ::webrtc::InitClassLoader;
} // namespace jni
} // namespace webrtc
#endif // SDK_ANDROID_SRC_JNI_CLASS_LOADER_H_

View File

@ -1,41 +0,0 @@
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef SDK_ANDROID_SRC_JNI_CLASS_REFERENCE_HOLDER_H_
#define SDK_ANDROID_SRC_JNI_CLASS_REFERENCE_HOLDER_H_
// TODO(magjed): Update external clients to call webrtc::jni::InitClassLoader
// immediately instead.
#include "sdk/android/native_api/jni/class_loader.h"
#include "sdk/android/src/jni/jni_helpers.h"
namespace webrtc {
namespace jni {
// Deprecated. Call webrtc::jni::InitClassLoader() immediately instead..
inline void LoadGlobalClassReferenceHolder() {
webrtc::InitClassLoader(GetEnv());
}
// Deprecated. Do not call at all.
inline void FreeGlobalClassReferenceHolder() {}
} // namespace jni
} // namespace webrtc
// TODO(magjed): Remove once external clients are updated.
namespace webrtc_jni {
using webrtc::jni::LoadGlobalClassReferenceHolder;
using webrtc::jni::FreeGlobalClassReferenceHolder;
} // namespace webrtc_jni
#endif // SDK_ANDROID_SRC_JNI_CLASS_REFERENCE_HOLDER_H_

View File

@ -13,7 +13,7 @@
#define JNIEXPORT __attribute__((visibility("default")))
#include "rtc_base/ssl_adapter.h"
#include "sdk/android/src/jni/class_reference_holder.h"
#include "sdk/android/native_api/jni/class_loader.h"
#include "sdk/android/src/jni/jni_helpers.h"
namespace webrtc {
@ -26,13 +26,12 @@ extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM* jvm, void* reserved) {
return -1;
RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()";
LoadGlobalClassReferenceHolder();
webrtc::InitClassLoader(GetEnv());
return ret;
}
extern "C" void JNIEXPORT JNICALL JNI_OnUnLoad(JavaVM* jvm, void* reserved) {
FreeGlobalClassReferenceHolder();
RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()";
}