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

Unified Diff: webrtc/modules/utility/include/jvm_android.h

Issue 2897423002: Revert of https://codereview.webrtc.org/2889183002/ (Closed)
Patch Set: new 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
Index: webrtc/modules/utility/include/jvm_android.h
diff --git a/webrtc/modules/utility/include/jvm_android.h b/webrtc/modules/utility/include/jvm_android.h
index 1fa5f9e6bed5c77cfce0709aaf57e1140552f735..51a0bd841a12d27a9d3af892e6a899659ba23dc3 100644
--- a/webrtc/modules/utility/include/jvm_android.h
+++ b/webrtc/modules/utility/include/jvm_android.h
@@ -118,7 +118,8 @@ class JNIEnvironment {
// JNIEnv* jni = ::base::android::AttachCurrentThread();
// JavaVM* jvm = NULL;
// jni->GetJavaVM(&jvm);
-// webrtc::JVM::Initialize(jvm);
+// jobject context = ::base::android::GetApplicationContext();
+// webrtc::JVM::Initialize(jvm, context);
//
// // Header (.h) file of example class called User.
// std::unique_ptr<JNIEnvironment> env;
@@ -144,12 +145,9 @@ class JNIEnvironment {
// JVM::Uninitialize();
class JVM {
public:
- // Stores global handles to the Java VM interface.
+ // Stores global handles to the Java VM interface and the application context.
// Should be called once on a thread that is attached to the JVM.
- static void Initialize(JavaVM* jvm);
- // TODO(sakal): Remove once downstream dependencies have been updated.
- // Deprecated old signature with Android context.
- static void Initialize(JavaVM* jvm, jobject context) { Initialize(jvm); }
+ static void Initialize(JavaVM* jvm, jobject context);
// Clears handles stored in Initialize(). Must be called on same thread as
// Initialize().
static void Uninitialize();
@@ -170,9 +168,10 @@ class JVM {
// TODO(henrika): can we make these private?
JavaVM* jvm() const { return jvm_; }
+ jobject context() const { return context_; }
protected:
- JVM(JavaVM* jvm);
+ JVM(JavaVM* jvm, jobject context);
~JVM();
private:
@@ -180,6 +179,7 @@ class JVM {
rtc::ThreadChecker thread_checker_;
JavaVM* const jvm_;
+ jobject context_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698