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

Unified Diff: webrtc/modules/utility/source/jvm_android.cc

Issue 2889183002: Reland of Removes usage of native base::android::GetApplicationContext() (Closed)
Patch Set: Remove unneeded include. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/utility/include/jvm_android.h ('k') | webrtc/pc/test/androidtestinitializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/utility/source/jvm_android.cc
diff --git a/webrtc/modules/utility/source/jvm_android.cc b/webrtc/modules/utility/source/jvm_android.cc
index 9d08688700748b0fce3f0defbd3e9b7810448e60..2228d3ad255db605dfaf5ce5387fa2c2513826b8 100644
--- a/webrtc/modules/utility/source/jvm_android.cc
+++ b/webrtc/modules/utility/source/jvm_android.cc
@@ -217,10 +217,10 @@ std::string JNIEnvironment::JavaToStdString(const jstring& j_string) {
}
// static
-void JVM::Initialize(JavaVM* jvm, jobject context) {
+void JVM::Initialize(JavaVM* jvm) {
ALOGD("JVM::Initialize%s", GetThreadInfo().c_str());
RTC_CHECK(!g_jvm);
- g_jvm = new JVM(jvm, context);
+ g_jvm = new JVM(jvm);
}
// static
@@ -237,11 +237,9 @@ JVM* JVM::GetInstance() {
return g_jvm;
}
-JVM::JVM(JavaVM* jvm, jobject context)
- : jvm_(jvm) {
+JVM::JVM(JavaVM* jvm) : jvm_(jvm) {
ALOGD("JVM::JVM%s", GetThreadInfo().c_str());
RTC_CHECK(jni()) << "AttachCurrentThread() must be called on this thread.";
- context_ = NewGlobalRef(jni(), context);
LoadClasses(jni());
}
@@ -249,7 +247,6 @@ JVM::~JVM() {
ALOGD("JVM::~JVM%s", GetThreadInfo().c_str());
RTC_DCHECK(thread_checker_.CalledOnValidThread());
FreeClassReferences(jni());
- DeleteGlobalRef(jni(), context_);
}
std::unique_ptr<JNIEnvironment> JVM::environment() {
« no previous file with comments | « webrtc/modules/utility/include/jvm_android.h ('k') | webrtc/pc/test/androidtestinitializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698