| Index: base/android/jni_android.cc
|
| diff --git a/base/android/jni_android.cc b/base/android/jni_android.cc
|
| index 6dc6a8dac0b1b4d134d1b2834fc24162dd3fc35c..59f25e2e817dbe6ea258d16b65b7d71e5bedb9ec 100644
|
| --- a/base/android/jni_android.cc
|
| +++ b/base/android/jni_android.cc
|
| @@ -97,7 +97,11 @@ bool IsVMInitialized() {
|
| return g_jvm != NULL;
|
| }
|
|
|
| -void InitApplicationContext(const JavaRef<jobject>& context) {
|
| +void InitApplicationContext(JNIEnv* env, const JavaRef<jobject>& context) {
|
| + if (env->IsSameObject(g_application_context.Get().obj(), context.obj())) {
|
| + // It's safe to set the context more than once if it's the same context.
|
| + return;
|
| + }
|
| DCHECK(g_application_context.Get().is_null());
|
| g_application_context.Get().Reset(context);
|
| }
|
|
|