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

Unified Diff: android_webview/native/aw_settings.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.cc ('k') | android_webview/native/aw_web_contents_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_settings.cc
diff --git a/android_webview/native/aw_settings.cc b/android_webview/native/aw_settings.cc
index 77892fd59a0e8101b5edeb55f59101a100af638f..5f0745d0249719300dffa3875782841a9fc85894 100644
--- a/android_webview/native/aw_settings.cc
+++ b/android_webview/native/aw_settings.cc
@@ -90,9 +90,9 @@ AwSettings::~AwSettings() {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jobject> scoped_obj = aw_settings_.get(env);
- jobject obj = scoped_obj.obj();
- if (!obj) return;
- Java_AwSettings_nativeAwSettingsGone(env, obj,
+ if (scoped_obj.is_null())
+ return;
+ Java_AwSettings_nativeAwSettingsGone(env, scoped_obj,
reinterpret_cast<intptr_t>(this));
}
@@ -122,10 +122,10 @@ void AwSettings::UpdateEverything() {
JNIEnv* env = base::android::AttachCurrentThread();
CHECK(env);
ScopedJavaLocalRef<jobject> scoped_obj = aw_settings_.get(env);
- jobject obj = scoped_obj.obj();
- if (!obj) return;
+ if (scoped_obj.is_null())
+ return;
// Grab the lock and call UpdateEverythingLocked.
- Java_AwSettings_updateEverything(env, obj);
+ Java_AwSettings_updateEverything(env, scoped_obj);
}
void AwSettings::UpdateEverythingLocked(JNIEnv* env,
@@ -260,11 +260,11 @@ void AwSettings::PopulateWebPreferences(WebPreferences* web_prefs) {
JNIEnv* env = base::android::AttachCurrentThread();
CHECK(env);
ScopedJavaLocalRef<jobject> scoped_obj = aw_settings_.get(env);
- jobject obj = scoped_obj.obj();
- if (!obj) return;
+ if (scoped_obj.is_null())
+ return;
// Grab the lock and call PopulateWebPreferencesLocked.
- Java_AwSettings_populateWebPreferences(
- env, obj, reinterpret_cast<jlong>(web_prefs));
+ Java_AwSettings_populateWebPreferences(env, scoped_obj,
+ reinterpret_cast<jlong>(web_prefs));
}
void AwSettings::PopulateWebPreferencesLocked(JNIEnv* env,
« no previous file with comments | « android_webview/native/aw_pdf_exporter.cc ('k') | android_webview/native/aw_web_contents_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698