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 |