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

Unified Diff: android_webview/native/aw_contents.cc

Issue 2295693004: Pass JavaRef to Java methods in android_webview. (Closed)
Patch Set: 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 | « android_webview/native/aw_contents.h ('k') | android_webview/native/aw_contents_background_thread_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index a986e2bc56381e2e994f1f6443961e055f3755a9..bcf3669a81b42c929ef43f90833f264331da830b 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -273,7 +273,7 @@ void AwContents::InitAutofillIfNecessary(bool enabled) {
AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
}
-void AwContents::SetAwAutofillClient(jobject client) {
+void AwContents::SetAwAutofillClient(const JavaRef<jobject>& client) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
@@ -399,8 +399,7 @@ void GenerateMHTMLCallback(ScopedJavaGlobalRef<jobject>* callback,
JNIEnv* env = AttachCurrentThread();
// Android files are UTF8, so the path conversion below is safe.
Java_AwContents_generateMHTMLCallback(
- env, ConvertUTF8ToJavaString(env, path.AsUTF8Unsafe()), size,
- callback->obj());
+ env, ConvertUTF8ToJavaString(env, path.AsUTF8Unsafe()), size, *callback);
}
} // namespace
@@ -1147,8 +1146,7 @@ void InvokeVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref,
ScopedJavaLocalRef<jobject> obj = java_ref.get(env);
if (obj.is_null())
return;
- Java_AwContents_invokeVisualStateCallback(env, obj, callback->obj(),
- request_id);
+ Java_AwContents_invokeVisualStateCallback(env, obj, *callback, request_id);
}
} // namespace
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | android_webview/native/aw_contents_background_thread_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698