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

Unified Diff: base/android/jni_android.h

Issue 1407233017: Define a Java-side global application context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo changes to ApplicationStatus Created 5 years, 1 month 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: base/android/jni_android.h
diff --git a/base/android/jni_android.h b/base/android/jni_android.h
index 9df904100edcfaea37fda0834eec1ead4d13628a..651005e5dd6217584a1fe70578ce1763949058f6 100644
--- a/base/android/jni_android.h
+++ b/base/android/jni_android.h
@@ -10,6 +10,9 @@
#include <string>
+// TODO(torne): remove this when callers of GetApplicationContext have been
+// fixed to include context_utils.h. http://crbug.com/552419
+#include "base/android/context_utils.h"
#include "base/android/scoped_java_ref.h"
#include "base/atomicops.h"
#include "base/base_export.h"
@@ -47,19 +50,12 @@ BASE_EXPORT JNIEnv* AttachCurrentThreadWithName(const std::string& thread_name);
// Detaches the current thread from VM if it is attached.
BASE_EXPORT void DetachFromVM();
-// Initializes the global JVM. It is not necessarily called before
-// InitApplicationContext().
+// Initializes the global JVM.
BASE_EXPORT void InitVM(JavaVM* vm);
// Returns true if the global JVM has been initialized.
BASE_EXPORT bool IsVMInitialized();
-// Initializes the global application context object. The |context| can be any
-// valid reference to the application context. Internally holds a global ref to
-// the context. InitVM and InitApplicationContext maybe called in either order.
-BASE_EXPORT void InitApplicationContext(JNIEnv* env,
- const JavaRef<jobject>& context);
-
// Initializes the global ClassLoader used by the GetClass and LazyGetClass
// methods. This is needed because JNI will use the base ClassLoader when there
// is no Java code on the stack. The base ClassLoader doesn't know about any of
@@ -69,11 +65,6 @@ BASE_EXPORT void InitReplacementClassLoader(
JNIEnv* env,
const JavaRef<jobject>& class_loader);
-// Gets a global ref to the application context set with
-// InitApplicationContext(). Ownership is retained by the function - the caller
-// must NOT release it.
-const BASE_EXPORT jobject GetApplicationContext();
-
// Finds the class named |class_name| and returns it.
// Use this method instead of invoking directly the JNI FindClass method (to
// prevent leaking local references).

Powered by Google App Engine
This is Rietveld 408576698