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

Unified Diff: components/cronet/android/chromium_url_request_context.cc

Issue 981013002: [Cronet] Make sure to only pass the application Context to InitApplicationContext to avoid DCHECK fa (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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: components/cronet/android/chromium_url_request_context.cc
diff --git a/components/cronet/android/chromium_url_request_context.cc b/components/cronet/android/chromium_url_request_context.cc
index 1544dde830415d06c7f4e49fe5550f875ff61a0e..9d0e550755663c64cddf2c3db3d599dd1e77eb83 100644
--- a/components/cronet/android/chromium_url_request_context.cc
+++ b/components/cronet/android/chromium_url_request_context.cc
@@ -63,7 +63,7 @@ bool ChromiumUrlRequestContextRegisterJni(JNIEnv* env) {
// Sets global user-agent to be used for all subsequent requests.
static jlong CreateRequestContextAdapter(JNIEnv* env,
jobject jcaller,
- jobject jcontext,
+ jobject japp_context,
jstring juser_agent,
jint jlog_level,
jstring jconfig) {
@@ -86,8 +86,9 @@ static jlong CreateRequestContextAdapter(JNIEnv* env,
}
// Set application context.
mef 2015/03/06 16:55:55 Do we need to call it at all if ensureInitialized
pauljensen 2015/03/06 17:16:52 ChromiumUrlRequestContext() doesn't call ensureIni
mef 2015/03/06 17:23:14 Good point. I think we do need to call ensureIniti
- base::android::ScopedJavaLocalRef<jobject> scoped_context(env, jcontext);
- base::android::InitApplicationContext(env, scoped_context);
+ base::android::ScopedJavaLocalRef<jobject> scoped_app_context(env,
+ japp_context);
+ base::android::InitApplicationContext(env, scoped_app_context);
// TODO(mef): MinLogLevel is global, shared by all URLRequestContexts.
// Revisit this if each URLRequestContext would need an individual log level.

Powered by Google App Engine
This is Rietveld 408576698