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

Unified Diff: android_webview/native/aw_pdf_exporter.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_pdf_exporter.h ('k') | android_webview/native/aw_settings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_pdf_exporter.cc
diff --git a/android_webview/native/aw_pdf_exporter.cc b/android_webview/native/aw_pdf_exporter.cc
index a30bac6d74feb836a319eff195b9be797e22f27b..7b39667d44459bda57cd90bd26dcfc006ddf6ed0 100644
--- a/android_webview/native/aw_pdf_exporter.cc
+++ b/android_webview/native/aw_pdf_exporter.cc
@@ -12,16 +12,16 @@
#include "printing/units.h"
using base::android::JavaParamRef;
+using base::android::JavaRef;
using base::android::ScopedJavaLocalRef;
namespace android_webview {
AwPdfExporter::AwPdfExporter(JNIEnv* env,
- jobject obj,
+ const JavaRef<jobject>& obj,
content::WebContents* web_contents)
- : java_ref_(env, obj),
- web_contents_(web_contents) {
- DCHECK(obj);
+ : java_ref_(env, obj), web_contents_(web_contents) {
+ DCHECK(!obj.is_null());
Java_AwPdfExporter_setNativeAwPdfExporter(
env, obj, reinterpret_cast<intptr_t>(this));
}
@@ -59,7 +59,7 @@ int MilsToDots(int val, int dpi) {
} // anonymous namespace
void AwPdfExporter::InitPdfSettings(JNIEnv* env,
- jobject obj,
+ const JavaRef<jobject>& obj,
printing::PrintSettings& settings) {
int dpi = Java_AwPdfExporter_getDpi(env, obj);
int width = Java_AwPdfExporter_getPageWidth(env, obj);
« no previous file with comments | « android_webview/native/aw_pdf_exporter.h ('k') | android_webview/native/aw_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698