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

Unified Diff: android_webview/native/android_protocol_handler.cc

Issue 2231923002: Make GetApplicationContext return a JavaRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also fix not-currently-compiled unit test Created 4 years, 4 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 | « no previous file | base/android/context_utils.h » ('j') | ui/base/clipboard/clipboard_android_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/android_protocol_handler.cc
diff --git a/android_webview/native/android_protocol_handler.cc b/android_webview/native/android_protocol_handler.cc
index 51c64f790f74550c9a6177e14e693a82d7e38fda..69233d547de25477a0aefd27ed71f0fc9b2b545c 100644
--- a/android_webview/native/android_protocol_handler.cc
+++ b/android_webview/native/android_protocol_handler.cc
@@ -112,12 +112,7 @@ class ContentSchemeRequestInterceptor : public AndroidRequestInterceptorBase {
static ScopedJavaLocalRef<jobject> GetResourceContext(JNIEnv* env) {
if (g_resource_context)
return g_resource_context->get(env);
- ScopedJavaLocalRef<jobject> context;
- // We have to reset as GetApplicationContext() returns a jobject with a
- // global ref. The constructor that takes a jobject would expect a local ref
- // and would assert.
- context.Reset(env, base::android::GetApplicationContext());
- return context;
+ return ScopedJavaLocalRef<jobject>(base::android::GetApplicationContext());
}
// AndroidStreamReaderURLRequestJobDelegateImpl -------------------------------
« no previous file with comments | « no previous file | base/android/context_utils.h » ('j') | ui/base/clipboard/clipboard_android_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698