Rename AttachCurrentThreadIfNeeded to avoid clash with function.

A function with the same name exists here [1]. If the two headers are included
together this causes compilation errors.

[1] - https://cs.chromium.org/chromium/src/third_party/webrtc/sdk/android/src/jni/jvm.h?l=27&rcl=82f96e6a56e6230e98ee70de5178d7de69795c26

Bug: None
Change-Id: Icbc680f24a02ec66ea2b5e2b6584a53042cf45c7
Reviewed-on: https://webrtc-review.googlesource.com/c/116662
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26229}
This commit is contained in:
Mirko Bonadei
2019-01-11 19:26:40 +01:00
committed by Commit Bot
parent 07dc1e8594
commit 977c82020c
6 changed files with 22 additions and 17 deletions

View File

@ -67,9 +67,9 @@ jclass LookUpClass(const char* name) {
return 0;
}
// AttachCurrentThreadIfNeeded implementation.
AttachCurrentThreadIfNeeded::AttachCurrentThreadIfNeeded() : attached_(false) {
RTC_LOG(INFO) << "AttachCurrentThreadIfNeeded::ctor";
// JvmThreadConnector implementation.
JvmThreadConnector::JvmThreadConnector() : attached_(false) {
RTC_LOG(INFO) << "JvmThreadConnector::ctor";
JavaVM* jvm = JVM::GetInstance()->jvm();
RTC_CHECK(jvm);
JNIEnv* jni = GetEnv(jvm);
@ -81,8 +81,8 @@ AttachCurrentThreadIfNeeded::AttachCurrentThreadIfNeeded() : attached_(false) {
}
}
AttachCurrentThreadIfNeeded::~AttachCurrentThreadIfNeeded() {
RTC_LOG(INFO) << "AttachCurrentThreadIfNeeded::dtor";
JvmThreadConnector::~JvmThreadConnector() {
RTC_LOG(INFO) << "JvmThreadConnector::dtor";
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (attached_) {
RTC_LOG(INFO) << "Detaching thread from JVM";