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

Unified Diff: chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc

Issue 1288183004: jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add some newlines for readability Created 5 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
Index: chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc
diff --git a/chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc b/chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc
index 892a4412e435aa683d7718302685a338e57a0160..1c1df8e6ee2214a8122f325ed5011b93d4823607 100644
--- a/chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc
+++ b/chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc
@@ -16,24 +16,27 @@ using base::android::ScopedJavaLocalRef;
namespace dom_distiller {
namespace android {
-jobject DomDistillerServiceFactoryAndroid::GetForProfile(JNIEnv* env,
- jclass clazz,
- jobject j_profile) {
+ScopedJavaLocalRef<jobject> DomDistillerServiceFactoryAndroid::GetForProfile(
+ JNIEnv* env,
+ jclass clazz,
+ jobject j_profile) {
dom_distiller::DomDistillerService* service =
dom_distiller::DomDistillerServiceFactory::GetForBrowserContext(
ProfileAndroid::FromProfileAndroid(j_profile));
DomDistillerServiceAndroid* service_android =
new DomDistillerServiceAndroid(service);
- return service_android->java_ref_.obj();
+ return ScopedJavaLocalRef<jobject>(service_android->java_ref_);
}
bool DomDistillerServiceFactoryAndroid::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
-jobject GetForProfile(JNIEnv* env, jclass clazz, jobject j_profile) {
- return DomDistillerServiceFactoryAndroid::GetForProfile(
- env, clazz, j_profile);
+ScopedJavaLocalRef<jobject> GetForProfile(JNIEnv* env,
+ jclass clazz,
+ jobject j_profile) {
+ return DomDistillerServiceFactoryAndroid::GetForProfile(env, clazz,
+ j_profile);
}
} // namespace android

Powered by Google App Engine
This is Rietveld 408576698